Thread Socket receive-Frage (35 answers)
Opened by H3llGhost at 2008-06-05 17:32

H3llGhost
 2008-06-07 19:22
#110862 #110862
User since
2007-10-14
60 Artikel
BenutzerIn
[default_avatar]
Also mein Code sieht nun folgendermaßen aus:

Code (perl): (dl )
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
if ($s_ip) { $ip = $s_ip . ":"; } else { $ip = "port "; }

my $s_socket = IO::Socket::INET->new(
        Proto=>"udp",
        LocalAddr=>"$s_ip",
        LocalPort=>"$s_port"
) or die ("\nCan't setup UDP socket on $ip:$s_port $!\n");

print("Opening UDP listen socket on $ip$s_port ... ok\n");

        while ($timeout % 60 == 0)
        {
                print "hier";
                if(IO::Select->new($s_socket)->can_read(2)) {  # 2 second timeout
                        while (my $rc = $s_socket->recv($s_output, 1024) ) {
                        $buffer .= $s_output;
                        }
                        print $buffer;
                        $timeout = 0;
                  # $s_socket->recv($s_output, 1024);
                  # print $s_output;
                } else {
                  $timeout++;
                }       
                print $timeout;
      }


Doch leider funktioniert das nicht ...
Hat jemand eine Idee, wie warum das bei mir nicht geht ...

View full thread Socket receive-Frage