Socket Question



Hi,

If using UNIX sockets, and my clients maximum recv() buffer data size
is 1024 bytes, and my server has say 5200 bytes to send, will my
clients recv buffer be full each time? Specifically i have recv()
going round in a loop and i want to know if a buffer with less than
1024 bytes in, is the end of a transmission?

So could i expect to receive 4 lots of data at 1024bytes + a small
remainder, or is this not something i can depend on to determine the
end of a transmission?

Going into more detail, my packets do have a termination point which
is indicated by a '.' on a line by itself, I check for this by
verifying 5 characters at the end of each recv() buffer which are
<CR><LF>.<CR><LF>. However, if my recv() buffer is < 5 characters i
get stuck in another iteration of the loop in a blocking recv() call
with no data to receive... So can i safely assume if the buffer
received from recv() is less that the max buffer size (i.e < 5 bytes
of a 1024 byte buffer) then its the end of a transmission?


Thanks for any help,
Jack
.



Relevant Pages

  • Re: BSD sockets: recv with MSG_WAITALL should return EWOULDBLOCK?
    ... (I am not convinced it is much use for blocking sockets ... many bytes as the size argument to recv() or to close the connection ... And this sounds like 'if you are using a buffer size that doesn't ... Another frame arrives and more data is queued to the socket buffer. ...
    (comp.unix.programmer)
  • Re: TdiBuildReceive question
    ... Irp->IoStatus.Information < the size of the buffer. ... then it is better to fill it as much as possible, and not complete the recv() ... To prevent such a time loss, the TCP protocol has a PSH bit ... PSH means - "the sender does not know when the next bytes will ...
    (microsoft.public.development.device.drivers)
  • Re: recv WSAENOBUFS error
    ... cross-posting, I did cross-post it initially, but I just started using ... it always asks for the "packet length" amount in the call to recv. ... You can set kernel-mode buffer with setsockopt but you'll quickly finish ...
    (microsoft.public.win32.programmer.kernel)
  • Re: recv WSAENOBUFS error
    ... it always asks for the "packet length" amount in the call to recv. ... You can set kernel-mode buffer with setsockopt but you'll quickly finish ... your non-page (kernel) memory if you'll start to do it. ...
    (microsoft.public.win32.programmer.kernel)
  • Re: recv WSAENOBUFS error
    ... it always asks for the "packet length" amount in the call to recv. ... You can set kernel-mode buffer with setsockopt but you'll quickly finish ... your non-page (kernel) memory if you'll start to do it. ...
    (microsoft.public.win32.programmer.networks)