Hi All,
I am hoping someone here can help me. First I will say I don't have a
lot of experience setting up socket connections. I am trying to set up
a socket connection using IO::Socket. I want to establish a socket
connection and keep it established. Can this be done? If so, what is
the best way to do it? Also, is there a way to test to see if there is
a socket connection already open on a certain port, other than netstat?
Something internal to perl or the module itself is what I was looking
for. Below is the snipet of code I am using.
Use IO::Socket;
if (! $socket){
$socket = IO::Socket::INET->new(PeerAddr => $ host, PeerPort => $
port, Proto => $protocol);
$socket->bind();
}
if ($socket) {
...do something like send data
}else{
...make sure no connections on port I want to use and then
open a new socket connection
}
Thanks,
Glen.
_______________________________________________
Perl-Unix-Users mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs