Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: Problems with INET, Select, and Win32

by ikegami (Patriarch)
on Nov 24, 2010 at 22:39 UTC ( [id://873550]=note: print w/replies, xml ) Need Help??


in reply to Problems with INET, Select, and Win32

PeerAddr => inet_ntoa(INADDR_BROADCAST),

That makes no sense for UDP. UDP is connectionless, so the socket has no peer.

The first is that the can_read never fires except for timeouts. If I take it out, the recv blocks and never completes.

I don't see why you say that's a problem. can_read should only return if recv won't block, so it appears to be working properly.

The second is that when I set $thread_stop (to kill the thread), Perl crashes when I execute the return.

There are really only two possible replies to that:

  • "Oh yeah, exiting a thread always crashes Perl."
  • "Odd, that shouldn't happen."

Would you care to guess which one it is? Hint: It's not the first. If you can't debug the crash yourself, perhaps you should give us something we can debug.

Replies are listed 'Best First'.
Re^2: Problems with INET, Select, and Win32
by bob0206 (Initiate) on Nov 25, 2010 at 07:26 UTC

    Getting rid of the peeraddr = ntoa (INADDR_BROADCAST) fixed the receive problem. I assumed adding this would enable input from any source but it does not. I would assume that what it really means is to take packets only from the broadcast IP address as a source (which would be very odd). thanks for the suggestion.

    As for the crash upon exiting the thread, I get the following message from strawberry perl:

    "Free to wrong pool e64070 not 3f67c8, <STDIN> line 1 during global destruction."

    the pool values change on each run.

      I would assume that what it really means is to take packets only from the broadcast IP address as a source (which would be very odd).

      I'm surprised that you can call connect for a connection-less socket, but I'm not surprised that it would only cause packets to be accepted form the address you specify to accept packets from. Your request was indeed very odd. Maybe you were thinking of INADDR_ANY. As for the crash upon exiting the thread, I get the following message from strawberry perl:

      "Free to wrong pool e64070 not 3f67c8, <STDIN> line 1 during global destruction."

      I can confirm that error message is related to threads. Still have nothing to debug.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://873550]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (4)
As of 2024-04-25 20:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found