Leser: 1
|< 1 2 3 4 ... 7 >| | 62 Einträge, 7 Seiten |
1 2 3 4 5 6 7
getlinefromsocket($socket) { my $buffer; my $char; while ($socken->recv($char,1)) $buffer+=$char; }
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
use IO::Socket; use strict; my $socket = new IO::Socket::INET (PeerAddr =>'PC110197',PeerPort => 1810) or die "Konnte Socket nicht erstellen: $!\n"; $socket->autoflush(1); print "Sende ein Client Create zum Server\n"; print $socket "CLIENT CREATE\n"; my $line; $socket->recv($line,3); print "$line\n"; print "Sende ein CONNECT zum Server\n"; print $socket "CONNECT\n"; $socket->recv($line,3); print "$line\n"; print "Sende ein DISCONNECT zum Server\n"; print $socket "DISCONNECT\n"; $socket->recv($line,3); print "$line\n"; print "Sende ein END SESSION zum Server\n"; print $socket "END SESSION\n"; $socket->recv($line,3); print "$line\n"; $socket->close(); getlinefromsocket($socket) { my $buffer; my $char; while ($socket->recv($char,1)) { $buffer+=$char; } }
1
2
3
syntax error at sock.pl line 27, near ") {"
syntax error at sock.pl line 34, near "}"
Execution of sock.pl aborted due to compilation errors.
1 2 3 4 5 6 7 8 9
getlinefromsocket() { my $socket = shift; my $buffer; my $char; while ($socket->recv($char,1)) { $buffer+=$char; } }
1
2
3
syntax error at sock.pl line 26, near ") {"
syntax error at sock.pl line 34, near "}"
Execution of sock.pl aborted due to compilation errors.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
use IO::Socket; use strict; my $socket = new IO::Socket::INET (PeerAddr =>'PC110197',PeerPort => 1810) or die "Konnte Socket nicht erstellen: $!\n"; $socket->autoflush(1); print "Sende ein Client Create zum Server\n"; print $socket "CLIENT CREATE\n"; my $line; $socket->recv($line,10); print "$line\n"; print "Sende ein CONNECT zum Server\n"; print $socket "CONNECT\n"; $socket->recv($line,10); print "$line\n"; print "Sende ein DISCONNECT zum Server\n"; print $socket "DISCONNECT\n"; $socket->recv($line,10); print "$line\n"; print "Sende ein END SESSION zum Server\n"; print $socket "END SESSION\n"; $socket->recv($line,10); print "$line\n"; $socket->close(); getlinefromsocket { my $socket = shift; my $buffer; my $char; while ($socket->recv($char,1)) { $buffer+=$char; } }
1
2
3
4
5
6
7
8
9
Sende ein Client Create zum Server
ACK
Sende ein CONNECT zum Server
ACK
Sende ein DISCONNECT zum Server
ACK
Sende ein END SESSION zum Server
ACK
Can't call method "recv" on an undefined value at sock.pl line 30.
|< 1 2 3 4 ... 7 >| | 62 Einträge, 7 Seiten |