server is numb?
From: Christian Stalp (stalp_at_imbei.uni-mainz.de)
Date: 09/28/04
- Next message: Gabor Urban: "Re: Perl editor you preffer"
- Previous message: Ricardo Pichler: "Measure program performance"
- Next in thread: Christian Stalp: "Re: server is numb?"
- Reply: Christian Stalp: "Re: server is numb?"
- Reply: Jeff 'japhy' Pinyan: "Re: server is numb?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
To: beginners@perl.org Date: Tue, 28 Sep 2004 09:56:15 +0200
Hello together,
I just tryed to make a simple Socket-Connection with a client and a server
which are connected with each other over localhost.
the server:
#!/usr/bin/perl
use IO::Socket;
use strict;
my $server_port = 3434;
my $server;
my $client;
my $in_line;
$server = IO::Socket::INET-> new ( LocalPort => $server_port,
Type => SOCK_STREAM,
Reuse => 1,
Listen => SOMAXCONN )
or die "unable to start server ! $@\n";
while ( $client = $server->accept () )
{
$in_line = <CLIENT>;
print "$in_line \n";
}
close ( $server );
__END_
and the client:
#!/usr/bin/perl
use IO::Socket;
use strict;
my $remote_host = "localhost";
my $remote_port = 3434;
my $socket;
my $data = "test";
$socket = IO::Socket::INET->new ( PeerAddr => $remote_host,
PeerPort => $remote_port,
Proto => "tcp",
Type => SOCK_STREAM )
or die "unable to establishe a connection !\n";
$socket-> send ( $data , $flags ) or die "could not send!\n";
close ( $socket );
__END_
I expact, that the data-string is send by the client to the server. When it
reaches the server, the server put it out, and keep on listening.
But the server does nothing at all, its numb?!?
What did I omitted? How I get the flags? With fcntl ?
Gruss Christian
- Next message: Gabor Urban: "Re: Perl editor you preffer"
- Previous message: Ricardo Pichler: "Measure program performance"
- Next in thread: Christian Stalp: "Re: server is numb?"
- Reply: Christian Stalp: "Re: server is numb?"
- Reply: Jeff 'japhy' Pinyan: "Re: server is numb?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|
|