Sockets, gui, threading questions

D

Dad

I'm really new to Perl so any help or direction on where to look is
welcomed.

I used the server example from the Perl Cookbook and modified it to accept
SNMP trap messages from a Linksys router on UDP port 162, process the
message as inbound, outbound, or unknown and store in the appropriate
mysql database table. I want to add a gui to the application and display
real-time statistics about traffic, etc. I used QTDesigner to build the
gui seprately and puic to create the final Perl code. The gui now works
great but only without the "server" code to get/process the traps. I'm
using IO::Socket for the network interface.

My problem seems to be the while ($sock->receive($trap,$MAX)) loop is
blocking and the program hangs until a trap comes in and the buttons on
the gui are essentially useless. Is there a better way to handle incoming
udp messages? How can I multi-thread so that the gui continues to
function and the displays are updated when a message is received? Is
there a call-back feature I can use?

Thanks,
 
B

Billy Ray Padgett

I'm really new to Perl so any help or direction on where to look is
welcomed.

I used the server example from the Perl Cookbook and modified it to accept
SNMP trap messages from a Linksys router on UDP port 162, process the
message as inbound, outbound, or unknown and store in the appropriate
mysql database table. I want to add a gui to the application and display
real-time statistics about traffic, etc. I used QTDesigner to build the
gui seprately and puic to create the final Perl code. The gui now works
great but only without the "server" code to get/process the traps. I'm
using IO::Socket for the network interface.

My problem seems to be the while ($sock->receive($trap,$MAX)) loop is
blocking and the program hangs until a trap comes in and the buttons on
the gui are essentially useless. Is there a better way to handle incoming
udp messages? How can I multi-thread so that the gui continues to
function and the displays are updated when a message is received? Is
there a call-back feature I can use?

Thanks,

Maybe you can find yourself an answer in BVA's tutorial!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top