ant has asked for the wisdom of the Perl Monks concerning the following question:
Hi
I have created two programs, one a server whick works correctly and a client program which when executed fails
and returns the error Illegal seek. Why? What does this mean? here is the code for client.
#!/opt/bin/perl
#print "Content-type: text/html\n\n";
use IO::Socket;
use Sys::Hostname;
$hostname = hostname();
print "hostname is $hostname \n";
$sock = new IO::Socket::INET (PeerAddr =>'$hostname',
PeerPort => 3334,
Proto => 'tcp'
);
die "Socket could not be created reason: $!\n " unless $sock;
foreach (1..10){
print $sock "Msg $_ : How are you? \n";
$sock->flush();
}
close ($sock);
Any help would be gratefully accepted.
Thanks
Ant
I have created two programs, one a server whick works correctly and a client program which when executed fails
and returns the error Illegal seek. Why? What does this mean? here is the code for client.
#!/opt/bin/perl
#print "Content-type: text/html\n\n";
use IO::Socket;
use Sys::Hostname;
$hostname = hostname();
print "hostname is $hostname \n";
$sock = new IO::Socket::INET (PeerAddr =>'$hostname',
PeerPort => 3334,
Proto => 'tcp'
);
die "Socket could not be created reason: $!\n " unless $sock;
foreach (1..10){
print $sock "Msg $_ : How are you? \n";
$sock->flush();
}
close ($sock);
Any help would be gratefully accepted.
Thanks
Ant
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Tcp client and servers
by merlyn (Sage) on Sep 27, 2000 at 19:16 UTC | |
by ant (Scribe) on Sep 27, 2000 at 20:00 UTC |
Back to
Seekers of Perl Wisdom