in reply to IO::Socket::INET $Socket->recv won't time out
from recv manual page in unix system( basically recv system call)
but perldoc -f recv says, (perl's recv function)
This call is actually implemented in terms of recvfrom(2) system call. See "UDP: Message Passing" in perlipc for examples.
so you can see man perlipc
I think in this case that server has nothing to give you immediately, you can use MSG_DONTWAIT flag in recv, (on unix systems see man recv for more information on flags to recv).
this will make recv to return immediately if no data is available on socket.
Alternatively you can use select function to wait for data to be ready on the socket , if it is ready go and read it using recv. See perldoc -f select or man perlipc
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: IO::Socket::INET $Socket->recv won't time out
by zwon (Abbot) on Mar 13, 2009 at 19:28 UTC |