|< 1 2 >| | 16 Einträge, 2 Seiten |
1
2
3
4
5
6
7
8
9
10
11
12
use strict;
use warnings;
use IO::Socket::INET;
my $socket = IO::Socket::INET -> new( LocalPort => 514,
Type => SOCK_STREAM)
or die "Keine Verbindung: $!\n";
my $hello = <$socket>;
print $hello;
close($socket);
Quote\n\nIf Proto is not given and you specify a symbolic PeerPort port, then the constructor will try to derive Proto from the service name. As a last resort Proto "tcp" is assumed. The Type parameter will be deduced from Proto if not specified.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use strict;
use warnings;
use IO::Socket::INET;
my $socket = IO::Socket::INET -> new( LocalPort => 514,
Type => SOCK_STREAM,
Proto => 'udp')
or die "Keine Verbindung: $!\n";
my $hello;
until (defined $hello) {
$hello = <$socket>
}
print $hello;
close($socket);
Keine Verbindung:
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
35
36
37
No. Time Source Destination Protocol Info
1 0.000000 192.168.2.1 192.168.2.101 Syslog LOCAL0.DEBUG: gigaset WA6005A[385]:**RIP P...
Frame 1 (138 bytes on wire, 138 bytes captured)
Arrival Time: Feb 21, 2006 19:57:22.638801000
Time delta from previous packet: 0.000000000 seconds
Time since reference or first frame: 0.000000000 seconds
Frame Number: 1
Packet Length: 138 bytes
Capture Length: 138 bytes
Protocols in frame: eth:ip:udp:syslog
Ethernet II, Src: 192.168.2.1 , Dst: 192.168.2.101
Destination: 192.168.2.101
Source: 192.168.2.1
Type: IP (0x0800)
Internet Protocol, Src: 192.168.2.1 (192.168.2.1), Dst: 192.168.2.101 (192.168.2.101)
Version: 4
Header length: 20 bytes
Differentiated Services Field: 0x00 (DSCP 0x00: Default; ECN: 0x00)
Total Length: 124
Identification: 0x38b9 (14521)
Flags: 0x00
Fragment offset: 0
Time to live: 64
Protocol: UDP (0x11)
Header checksum: 0xbc01 [correct]
Source: 192.168.2.1 (192.168.2.1)
Destination: 192.168.2.101 (192.168.2.101)
User Datagram Protocol, Src Port: syslog (514), Dst Port: syslog (514)
Source port: syslog (514)
Destination port: syslog (514)
Length: 104
Checksum: 0x0744 [correct]
Syslog message: LOCAL0.DEBUG: gigaset WA6005A[385]:**RIP P...
1000 0... = Facility: LOCAL0 - reserved for local use (16)
.... .111 = Level: DEBUG - debug-level messages (7)
Message: gigaset WA6005A[385]:**RIP Packet** 192.168.1.1, 520->> 192.168.1.7, 520 (from WAN Inbound)
|< 1 2 >| | 16 Einträge, 2 Seiten |