Don't use <$client> to read from a client socket. Perl tries to read 4k of data (or less, or more) before it starts to look for a newline in the data. You want to wait until data is available and then read all the available data but not more. You should use the read() and write() calls for that. If you plan to handle more than one client at the same time, you will need to handle more than one socket, which is what the select function is for, or, more nicely encapsulated, the IO::Select module.
For testing such stuff, I found the telnet programs to be very useful as they allow you to manually enter the data to your server so you can conveniently see what actually gets sent.
In reply to Re: Winsock connect problem in perl!!!
by Corion
in thread Winsock connect problem in perl!!!
by madtoperl
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |