Hello Monks...
I am trying to write up a Client/Server Script using IO::Socket::INET and I continue to get strange results.
I am using a fork to allow the server to serve multiple clients.
It seemed everything was working, but now it seems to be hanging just after the fork call.
The first client connects and everything is fine. Then the second client connects, the program tries to fork and the stops. As soon as the first client disconnects then the second client continues normally.
I don't believe the problem is related to the FORK, it seems to be related to reading from the sockets.
I generally read and write to the sockets as such:
print $socket "Hi there\n";
my $msg = <$socket>;
If anyone has some experience with this please help. I've gone through examples and docs I could find on the web, but they don't seem to work very well either :)
OS Info: Window 2000 sp2
Perl Info:v5.6.1 built for MSWin32-x86-multi-thread
(with 1 registered patch, see perl -V for more detail)
Binary build 626 provided by ActiveState Tool Corp.
Built 01:31:15 May 2 2001
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.