in reply to Re: Thread-safe modules and callbacks
in thread Thread-safe modules and callbacks
The server just redirects messages to the callback and the callback gets executed on the message thread so we don't share variables unless we specifically share them, but we want to abstract the user from the threads, I'm not sure if it is possible at all.my $MsgListener = new Msg::Server(2222,\&messageHandler); $MSGListener->Start(); sub messageHandler{ my $message = shift; my $peer = shift; chomp($message); print "MSG from $peer -> $message\n"; my @tokens = split(' ',$message); my $token }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Thread-safe modules and callbacks
by BrowserUk (Patriarch) on May 10, 2008 at 01:04 UTC | |
by Saladino (Beadle) on May 10, 2008 at 09:53 UTC | |
by BrowserUk (Patriarch) on May 10, 2008 at 13:52 UTC | |
by Saladino (Beadle) on May 10, 2008 at 14:25 UTC | |
by BrowserUk (Patriarch) on May 10, 2008 at 15:03 UTC | |
|