data not arriving at client (bsd-sockets)
data not arriving at client (bsd-sockets)
- Subject: data not arriving at client (bsd-sockets)
- From: Robert Kuilman <email@hidden>
- Date: Sun, 18 May 2003 17:16:04 +0200
Hey all!
I've been working on a client/server application (communicating between
MacOS X(client) and Linux(server))
This Application sends over structures (no worries about byte-ordering
and all, they're both mac). But there seems to be
a problem.
C: send packet
S: reply
C: receive packet
C: process data.
that seems normal... but then when i send another packet, i have to
'ask' for it twice.
like this:
C: send packet
S: reply
C: receive packet <no data>
C: receive packet
C: process data
the code i use for receiving data is as follows.
bzero(buffer, buffer_size);
bytes_read = read(mySocket, buffer, buffer_size );
bytes_read inidicates says it received 2048 bytes (size of my struct)
but there's simply nothing in there!
the second time i call this code, it does receive data...
replacing the 'read' function with standard 'recv' doesnt make a diff.
This gives me the idea, the tcp-buffer should be pushed or something,
anyone has a clue as to what the sollution
to my problem could be ?
Thanks In Advance :-)
Robert K.
web:
http://halfduplex.net/
email: email@hidden
------------------------------------------------------------------------
---------------------
"If everything seems to be going well, you have obviously overlooked
something."
- Steven Wright
_______________________________________________
macnetworkprog mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/macnetworkprog
Do not post admin requests to the list. They will be ignored.