Getting Local Port Number in Perl
Collapse
X
-
You are almost there, the following methods will supply the info you need.
The following methods can be used on socket filehandle objects created by IO::Socket::INE T:
* sockaddr
* sockport
* sockhost
* peeraddr
* peerport
* peerhost
For more info try http://docstore.mik.ua/orelly/perl/perlnut/ch13_02.htmLeave a comment:
-
i am using these codes :
I am using the IO:Socket moduleCode:$r_socket = IO::Socket::INET->new(PeerAddr => $ServerIP,PeerPort => $ServerPort,Proto => 'tcp') or die("Socket Error Connection");Leave a comment:
-
how are you calling your socket
have you tried?
socketpair(DOMA IN, TYPE, PROTOCOL)Leave a comment:
-
I am trying to get the client to send its port to the server for authentication. ..
my perl script resides on the client..Leave a comment:
-
Let me clear up on this, you are trying to get the client to send its port to the server for auth?
or are you trying just to find out what port the client is running on?Leave a comment:
-
Getting Local Port Number in Perl
Hi to all,
I am currently developing an application in perl that is capable of connecting to a server and sends information..
the server has a deamon that listens to the socket connections. It requires a socket port number of the client used in making a socket connection for validation..
is there a way in perl in which i can get the local port number (client side) used in making a socket connection to the server?(using Socket and IO:Socket libraries only)
Regards,
Mark TanTags: None
Leave a comment: