valhalla418 has asked for the wisdom of the Perl Monks concerning the following question:
Help I'm stuck!
I need to talk to a piece of kit that uses UDP to accept binary commands and send back replies. One UDP packet sent to the unit will result in one reply packet sent back to the IP/port that it came from.
I'm trying to create a set of packages/objects to communicate with the unit. The main object I've created is the session object. When I create an instance of session I want it to send a login command and receive the reply and then have a thread that will receive and process each reply as it comes until the session is destroyed.
My problem is sharing the socket connection between the session object (to send commands) and the thread it creates (to recv replies).
I've tried two approaches which both fail:
I've run out of ideas of how to get this to work. Anybody know of another way to do this? I'm using ActiveState 5.8 in WinXP
Thanks!
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Threaded UDP Communication
by acid06 (Friar) on Feb 17, 2006 at 00:58 UTC | |
by valhalla418 (Novice) on Feb 17, 2006 at 13:36 UTC | |
by valhalla418 (Novice) on Feb 17, 2006 at 15:41 UTC | |
by BrowserUk (Patriarch) on Feb 25, 2006 at 09:05 UTC | |
|
Re: Threaded UDP Communication
by renodino (Curate) on Feb 16, 2006 at 22:14 UTC | |
|
Re: Threaded UDP Communication
by jdhedden (Deacon) on Feb 16, 2006 at 19:41 UTC |