Re: IO::Socket Stop listening for new connections after initial connection
- From: sgt_b2002@xxxxxxxxx
- Date: 19 Jan 2006 10:04:05 -0800
> One thing is that you really should use strict; use warnings; and check
> the success of your system calls. If you did that, I think the problem
> would have made itself more clear to you.
I'll be doing that from now on.
> Here is the root cause of the problem. You are closing $agent_sock, but
> then leaving it in the watch list for the IO::Select object.
>
> You want to do:
>
> $sel->remove($agent_sock);
> close $agent_sock;
That did it! Soon as I added the $sel->remove for the two sockets
everything worked as it should. I should be able to incorporate this
into my project now.
I did try this initially, but did the $sel->remove *after* I closed the
socket.
close $agent_sock;
$sel->remove($agent_sock);
That caused the test program to break (input would not echo to the
other console). I'm guessing using strict, warnings, and checking
system call success would tell me why. Placing the $sel-remove *before*
I close the socket, as you suggest, works.
Thank you so much for your help, I really do appreciate it. :)
.
- References:
- IO::Socket Stop listening for new connections after initial connection
- From: sgt_b2002
- Re: IO::Socket Stop listening for new connections after initial connection
- From: xhoster
- Re: IO::Socket Stop listening for new connections after initial connection
- From: sgt_b2002
- Re: IO::Socket Stop listening for new connections after initial connection
- From: xhoster
- IO::Socket Stop listening for new connections after initial connection
- Prev by Date: Re: traversing a hash two using serveral conditions
- Next by Date: Reference Confusion
- Previous by thread: Re: IO::Socket Stop listening for new connections after initial connection
- Next by thread: while sleep 4; cat temperature
- Index(es):
Relevant Pages
|