in reply to TCP Socket not receiving.
while(<$new_sock>) {
You are using readline to read from your socket. That means that it will read bytes until it sees a byte or bytes that match the current value of $/ (the input separator), which by default is set to "\n".
For networking purposes, a newline is defined to be ascii(13-decimal) + ascii(10-decimal)
As your data doesn't contain a newline character, those reads continue to wait.
If you redefined the input separator to be EOT (ie. $/ = chr(4);), then your code would probably work as expected.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: TCP Socket not receiving.
by ghopwood (Initiate) on Jul 24, 2012 at 16:48 UTC |