in reply to (tye)Re2: IO:Socket::NET problem & Counter-Strike
in thread IO:Socket::NET problem & Counter-Strike

Okay, then I am confused. I am not so sharp, so give me a leg up here. Would you mind actually composing an example socket for me?

You are of course right about the NEW statment, moving the creation to outside of the loop does run, but when I start the other script to listen on port 50000 it says that the socket is already in use. I am lost boss.

-Myron DaChump

  • Comment on Re: (tye)Re2: IO:Socket::NET problem & Counter-Strike

Replies are listed 'Best First'.
(tye)Re3: IO:Socket::NET problem & Counter-Strike
by tye (Sage) on Mar 31, 2001 at 10:13 UTC

    Hm, it looks like you somehow change "Peer" to "Local" when you moved those lines. Change "Local" back to "Peer" and try again.

    Update: Note the >>>Tagged<<< parts:

    while ($socket->recv(my $in, 1024) ) { my $sock = IO::Socket::INET->new( Proto => 'udp', >>>Peer<<<Addr =>'127.0.0.1:50000'); print $sock $in; }
    To this....
    my $sock = IO::Socket::INET->new( Proto => 'udp', >>>Local<<<Addr =>'127.0.0.1:50000'); while ($socket->recv(my $in, 1024) ) { print $sock $in; }
    so the code should look like this:
    my $sock = IO::Socket::INET->new( Proto => 'udp', PeerAddr =>'127.0.0.1:50000'); while ($socket->recv(my $in, 1024) ) { print $sock $in; }

            - tye (but my friends call me "Tye")