enterdavertex
Programmer
Server
Code:
#! /usr/bin/perl -w
use FileHandle;
use Socket;
$filename = "/tmp/temporarily";
socket(SERVER,PF_UNIX, SOCK_STREAM, 0) or die"Can't create socket SERVER\n";
autoflush SERVER 1;
bind(SERVER,sockaddr_un("/tmp/0805638") or die"Can't bind server\n";
listen(SERVER,0) or die"Can't listen";
for(;
{
accept(DATA,SERVER);
print <DATA>;
close DATA;
}
error Wrote:
Useless use of a constant in void context at Server.pl line 7.
syntax error at Server.pl line 7, near ""Can't bind server\n";"
Execution of Server.pl aborted due to compilation errors.
Code:
#! /usr/bin/perl -w
use FileHandle;
use Socket;
$filename = "/tmp/temporarily";
socket(SERVER,PF_UNIX, SOCK_STREAM, 0) or die"Can't create socket SERVER\n";
autoflush SERVER 1;
bind(SERVER,sockaddr_un("/tmp/0805638") or die"Can't bind server\n";
listen(SERVER,0) or die"Can't listen";
for(;
accept(DATA,SERVER);
print <DATA>;
close DATA;
}
error Wrote:
Useless use of a constant in void context at Server.pl line 7.
syntax error at Server.pl line 7, near ""Can't bind server\n";"
Execution of Server.pl aborted due to compilation errors.
Client
Code:
#! /usr/bin/perl -w
use FileHandle;
use Socket;
socket (CLIENT, PF_UNIX, SOCK_STREAM, 0) or die "socket: $!";
autoflush CLIENT 1;
connect(CLIENT, sockaddr_un($filename)) or die "connect: $!";
accept(DATA,CLIENT);
print CLIENT "I have now sent you some very important information";
error said:#! /usr/bin/perl -w
use FileHandle;
use Socket;
socket (CLIENT, PF_UNIX, SOCK_STREAM, 0) or die "socket: $!";
autoflush CLIENT 1;
connect(CLIENT, sockaddr_un($filename)) or die "connect: $!";
accept(DATA,CLIENT);
print CLIENT "I have now sent you some very important information";