in reply to recv byte length problem?
I take this to mean that SCALAR will have the number of bytes read, but not regardless of LENGTH. If the number of bytes read is less than LENGTH (e.g. the socket has closed), then the length of SCALAR will be less then LENGTH as well. If however, there are more bytes in the socket's buffer than LENGTH, SCALAR will contain LENGTH bytes, and the remaining bytes stay in the socket buffer.SCALAR will be grown or shrunk to the length actually read.
So, the actually read part is specified for the case where you read less bytes than LENGTH.
As to dynamically increasing LENGTH, I do not know what you mean exactly, but you can specify a different length in different recv()'s:
recv($socket, $string1, 512, 0); recv($socket, $string2, 256, 0):
CU
Robartes- hoping this makes some sense
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: recv byte length problem?
by peschkaj (Pilgrim) on Nov 06, 2002 at 16:11 UTC |