Winsock2 - RECV not receiving in some context

Context of my problem:
Using C++ ( on the client side ) I send a login with wrong parameter ( ON purpose ) and the server-side is sending me a logout message.
I am always able to send and receive correctly and the event is launched fine.
We have different scenario and parameters for the login: wrong username, wrong domain , wrong location .. The server always send a message for logout and disconnect the client.

Only in one case the RECV() is getting -1 ( when i send on purpose a wrong sequence of a message). While i can see the message using a network sniffer i was not able to receive this message. It always give me -1.

Can anyone help?

Below is the packets from the sniffer

Client

No. Time Source Destination Protocol Length Info Source port Dest Port UTC Time
221 8.230778000 192.168.52.45 172.18.23.10 FIX 157 Logon giop-ssl 20605 12:50:45.483533000

Frame 221: 157 bytes on wire (1256 bits), 157 bytes captured (1256 bits) on interface 0
Ethernet II, Src: Hewlett-_eb:92:6c (00:21:5a:eb:82:dd), Dst: Cisco_e9:30:00 (00:22:0d:c9:30:11)
Internet Protocol Version 4, Src: 192.168.52.45 (192.168.52.45), Dst: 172.18.23.10 (172.18.23.10)
Transmission Control Protocol, Src Port: giop-ssl (2482), Dst Port: 20605 (20605), Seq: 1, Ack: 1, Len: 103
Financial Information eXchange Protocol
BeginString (8): FIX.4.2
BodyLength (9): 81
MsgType (35): A (LOGON)
MsgSeqNum (34): 17
SenderCompID (49): 00000005
SendingTime (52): 20120919-12:50:48.061
TargetCompID (56): DSMD
SenderLocationID (142): GIGConn2
EncryptMethod (98): 0 (NONE OTHER)
HeartBtInt (108): 35
CheckSum (10): 085 [correct]

Server 1

No. Time Source Destination Protocol Length Info Source port Dest Port UTC Time
222 8.231073000 172.18.23.10 192.168.52.45 TCP 60 20605 > giop-ssl [ACK] Seq=1 Ack=104 Win=5840 Len=0 20605 giop-ssl 12:50:45.483828000

Frame 222: 60 bytes on wire (480 bits), 60 bytes captured (480 bits) on interface 0
Ethernet II, Src: Cisco_e9:30:00 (00:22:0d:c9:30:11), Dst: Hewlett-_eb:92:6c (00:21:5a:eb:82:dd)
Internet Protocol Version 4, Src: 172.18.23.10 (172.18.23.10), Dst: 192.168.52.45 (192.168.52.45)
Transmission Control Protocol, Src Port: 20605 (20605), Dst Port: giop-ssl (2482), Seq: 1, Ack: 104, Len: 0

Server 2

No. Time Source Destination Protocol Length Info Source port Dest Port UTC Time
223 8.231320000 172.18.23.10 192.168.52.45 FIX 203 Logout 20605 giop-ssl 12:50:45.484075000

Frame 223: 203 bytes on wire (1624 bits), 203 bytes captured (1624 bits) on interface 0
Ethernet II, Src: Cisco_e9:30:00 (00:22:0d:c9:30:11), Dst: Hewlett-_eb:92:6c (00:21:5a:eb:82:dd)
Internet Protocol Version 4, Src: 172.18.23.10 (172.18.23.10), Dst: 192.168.52.45 (192.168.52.45)
Transmission Control Protocol, Src Port: 20605 (20605), Dst Port: giop-ssl (2482), Seq: 1, Ack: 104, Len: 149
Financial Information eXchange Protocol
BeginString (8): FIX.4.2
BodyLength (9): 126
MsgType (35): 5 (LOGOUT)
MsgSeqNum (34): 88
SenderCompID (49): DSMD
TargetCompID (56): 00000005
SendingTime (52): 20120919-12:50:42
Text (58): logon sequence number is less than expected [expected=24, received=17]
CheckSum (10): 045 [correct]

Server 3

No. Time Source Destination Protocol Length Info Source port Dest Port UTC Time
224 8.231322000 172.18.23.10 192.168.52.45 TCP 60 20605 > giop-ssl [RST, ACK] Seq=150 Ack=104 Win=5840 Len=0 20605 giop-ssl 12:50:45.484077000

Frame 224: 60 bytes on wire (480 bits), 60 bytes captured (480 bits) on interface 0
Ethernet II, Src: Cisco_e9:30:00 (00:22:0d:c9:30:11), Dst: Hewlett-_eb:92:6c (00:21:5a:eb:82:dd)
Internet Protocol Version 4, Src: 172.18.23.10 (172.18.23.10), Dst: 192.168.52.45 (192.168.52.45)
Transmission Control Protocol, Src Port: 20605 (20605), Dst Port: giop-ssl (2482), Seq: 150, Ack: 104, Len: 0


[ One can see I made a logon and then the server (1) ACKnowledges (2) send a logout with a util message (3) send a RS - I cannot receive the util message T ]

........
Last edited on
Topic archived. No new replies allowed.