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.
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.