Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

messager: multiple sends sometimes disappear at server #1

Open
twood02 opened this issue Mar 29, 2015 · 0 comments
Open

messager: multiple sends sometimes disappear at server #1

twood02 opened this issue Mar 29, 2015 · 0 comments
Labels

Comments

@twood02
Copy link
Member

twood02 commented Mar 29, 2015

First, get the code with git checkout bug-multi-message. This has been modified so the server loops, receiving multiple messages from the client, and the client is set to send three messages in sequence.


When the client sends multiple messages to the server, sometimes the server only prints out the first or second message. Weird!??!

Here the server only prints "first message", even though the client sends 3 different messages ("first message", "message 2", and "message 3"):

$ ./server
listening on port: 1234
Client ip: 127.0.0.1.
Message (34): [first message]
Client disconnected.

## tcpdump showing all three messages (in this case messages 2 and 3 were sent in one packet)
sudo tcpdump -A -i lo0 port 1234
....
22:55:10.366857 IP localhost.64833 > localhost.search-agent: Flags [P.], seq 1:15, ack 1, win 9186, options [nop,nop,TS val 746563681 ecr 746563681], length 14
E..B5h@[email protected]...=<.Q.....#..6.....
,..a,..afirst message.
22:55:10.366874 IP localhost.search-agent > localhost.64833: Flags [.], ack 15, win 9185, options [nop,nop,TS val 746563681 ecr 746563681], length 0
E..4.d@[email protected]....=<...#..(.....
,..a,..a
22:55:10.366878 IP localhost.64833 > localhost.search-agent: Flags [FP.], seq 15:35, ack 1, win 9186, options [nop,nop,TS val 746563681 ecr 746563681], length 20
E..H+$@[email protected]...=<.Q.....#..<.....
,..a,..amessage 2.message 3.

I ran the client a few more time and occasionally it gets all the messages:

Client ip: 127.0.0.1.
Message (14): [first message]
Message (10): [message 2]
Message (10): [message 3]
Client disconnected.

Other times it only gets two of them:

Client ip: 127.0.0.1.
Message (14): [first message]
Message (20): [message 2]
Client disconnected.

Why is this happening? We are using a TCP socket, so we shouldn't be losing any data!

@twood02 twood02 added the bug label Mar 29, 2015
@twood02 twood02 changed the title Bug: multiple sends sometimes disappear at server messager: multiple sends sometimes disappear at server Mar 29, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant