From: Michelle D. <md...@oc...> - 2012-07-27 04:16:28
|
I'm trying to create a simple MH perl code file which listens on a socket (port 8766) for simple test messages, and takes actions based on the message. I would like to be able to test it with netcat, something like echo "event 123" | nc -w 3 othermachine 8766 I found an example for lirc but it connects to a service which is already listening on a port. This time it becomes the listener. Can someone post a sample code snippet? I tried this but always get an error on startup that can't open the port: $axis_client = new Socket_Item(undef, undef,'localhost:8770','axiscameras','tcp','record'); if ($Startup) { start $axis_client; } Thanks |