I can't really answer your question, but I can give you advice that might be helpful since I have written a few TCP -> Serial perl scripts. If you have $100 laying around, I would recommend a UDS-10 by
. I have used about 35 of them already at my company to monitor equipment. These devices act as a serial to ethernet bridge. They sit on the network and get an IP via DHCP if you want them to, and the listen to a RS-232 port on the other side. All you need to do is connect a socket to the device at port 10001 (or whatever you assign it to) and you can easily have bidirectional communications. Also, the UDS-10 has a 2K buffer for receiving, so if the serial port is spitting out information while you are sending it information, it will still work correctly. This is a very nice little gadget.