Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
9
Task/Sockets/Perl/sockets-1.pl
Normal file
9
Task/Sockets/Perl/sockets-1.pl
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
use Socket;
|
||||
|
||||
$host = gethostbyname('localhost');
|
||||
$in = sockaddr_in(256, $host);
|
||||
$proto = getprotobyname('tcp');
|
||||
socket(Socket_Handle, AF_INET, SOCK_STREAM, $proto);
|
||||
connect(Socket_Handle, $in);
|
||||
send(Socket_Handle, 'hello socket world', 0, $in);
|
||||
close(Socket_Handle);
|
||||
7
Task/Sockets/Perl/sockets-2.pl
Normal file
7
Task/Sockets/Perl/sockets-2.pl
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
use Socket::Class;
|
||||
|
||||
$sock = Socket::Class->new(
|
||||
'remote_port' => 256,
|
||||
) || die Socket::Class->error;
|
||||
$sock->send('hello socket world');
|
||||
$sock->free;
|
||||
Loading…
Add table
Add a link
Reference in a new issue