Socket Question
- From: Jason <jecheney@xxxxxxxxx>
- Date: Thu, 31 Jan 2008 11:20:46 -0800 (PST)
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
.
- Follow-Ups:
- Re: Socket Question
- From: Rick Jones
- Re: Socket Question
- From: David Schwartz
- Re: Socket Question
- From: Frank Cusack
- Re: Socket Question
- Prev by Date: Re: Why I can not truncate a file with Posix 1990 ?
- Next by Date: Re: Socket Question
- Previous by thread: Why I can not truncate a file with Posix 1990 ?
- Next by thread: Re: Socket Question
- Index(es):
Relevant Pages
|
|