how to specify which port to use using INET in perl
- by alex
Hi:
I am using perl INET to create inter-process communication in my program. I need to use a specific port number in my TCP client. I was following the example in Perl doc, but it doesn't work. Here is my code:
old code(working):
tx_socket = new IO::Socket::INET-new('127.0.0.1:8001') || die "Can't connect to 127.0.0.1:8001 : $!\n";
new code(not working):
tx_socket = new IO::Socket::INET-new('127.0.0.1:8001', LocalPort=9000 ) || die "Can't connect to 127.0.0.1:8001 : $!\n";
Does anyone know what's wrong?
Thanks