Citation :
sub Envoyer()
{
print "IP ->> $ip" . "\n";
print "PORT ->> $port" . "\n";
print "PSEUDO ->> $pseudo" . "\n";
$fenetre_connection -> destroy;
$serv_addr = $ip;
$serv_port = $port;
my $socket = IO::Socket::INET->new(PeerAddr => $serv_addr,
PeerPort => $serv_port,
Proto => "tcp",
Type => SOCK_STREAM)
or die {print "bof\n"};
#envoi d'un message au serveur
print $socket "NEW $pseudo\n";
my $reponse = <$socket>;
print "$reponse";
print $socket "USERS\n";
my $reponse2 = <$socket>;
print "$reponse2";
my @users = split / /, $reponse2;
@players = split /;/, $users[1];
#players players1:free players2:free
my @name_players = split /, $players[0];
# close($socket); }
|