jomonantony has asked for the wisdom of the Perl Monks concerning the following question:
Hi Monks
I am using the following code for getting request from the clients. I want to know where the requests from the clients are stored? is it in an array? if it, how can I get that array?
Please help me.
#tcpserver.pl #Developed: Jomon C Antony 28-05-2010 #Purpos: To imploment Snail Mail use IO::Socket; use vars qw($dbh %GLOBS $INVOICE $PRINTER $q); $| = 1; require "snail.conf"; $socket = new IO::Socket::INET ( #LocalHost => '127.0.0.1', LocalHost => '192.168.25.77', LocalPort => '5000', Proto => 'tcp', Listen => 5, Reuse => 1 ); die "Coudn't open socket" unless $socket; print "\nTCPServer Waiting for client on port 5000"; while(1) { $client_socket = ""; $client_socket = $socket->accept(); $peer_address = $client_socket->peerhost(); $peer_port = $client_socket->peerport(); print "\n I got a connection from ( $peer_address , $peer_port ) " +; while (1) { $client_socket->recv($recieved_data,1024); print "\n RECIEVED: $recieved_data"; if($recieved_data eq "Client SnailMail") { `download.pl`; } print "completed."; close $client_socket; last; } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Where TCP server stores the client requests?
by jethro (Monsignor) on Jun 28, 2010 at 11:15 UTC | |
|
Re: Where TCP server stores the client requests?
by Anonymous Monk on Jun 28, 2010 at 12:15 UTC | |
|
Re: Where TCP server stores the client requests?
by Anonymous Monk on Jun 28, 2010 at 10:45 UTC |