Hi there,
I am trying to open a socket connection to send some data, in order to get the response data from the other end.
I found the way to send the data over, but can any one point me to how I can receive the response data from "testhost"?
I am trying to open a socket connection to send some data, in order to get the response data from the other end.
I found the way to send the data over, but can any one point me to how I can receive the response data from "testhost"?
Code:
1 use IO::Socket;
2 my $sock = new IO::Socket::INET (
3 PeerAddr => 'testhost',
4 PeerPort => '7070',
5 Proto => 'tcp',
6 );
7 die "Could not create socket: $!\n" unless $sock;
8 print $sock "get number users";
9 close($sock);