Operating System - HP-UX
1844066 Members
2635 Online
110227 Solutions
New Discussion

send/recv problem in HPUX 11

 
Thomas Mowell
New Member

send/recv problem in HPUX 11

I'm working with an application where I'm sending data over a socket connection using send/recv to transmit the data. The protocol that I have in place is that first I send a 4 byte integer containing the amount of data in the next packet. The next packet contains the data. On the recv side what is happening is that I get the first 4 bytes. Then I go to receive the packet. I get a partial packet. I do another recv call to get the rest of the data but I not only get the rest of the data I get the 4 byte integer for the next packet. I'm using the MSG_WAITALL flag on both send and recv. Any ideas?
3 REPLIES 3
Berlene Herren
Honored Contributor

Re: send/recv problem in HPUX 11

Thomas what version OS are you running? There maybe a tunable parameter you can use for this.

Berlene
http://www.mindspring.com/~bkherren/dobes/index.htm
Thomas Mowell
New Member

Re: send/recv problem in HPUX 11

I'm running on HPUX 11 64 bit.
Colin Bieberstein
New Member

Re: send/recv problem in HPUX 11

Try leaving out the MSG_WAITALL on both ends.

Then adjust your receiving side to recv in a loop with MSG_PEEK until it can receive the specified number of bytes and finally call recv without MSG_PEEK to take the data off the incomming buffer.

Hope that this helps...