Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re: Net::IRC does not connect

by le (Friar)
on May 02, 2001 at 23:47 UTC ( #77484=note: print w/replies, xml ) Need Help??


in reply to Net::IRC does not connect

I had similar problems here, using Net::IRC version 0.7.

After digging around a little in the code, I found that in Net::IRC::Connection, in the connect() sub, Symbol.pm's "gensym" method was used to create an anonymous glob, which then was turned into a socket (the code snippets you posted, plus a few more).

A little above this code, I found a commented section of code, that uses IO::Socket to create a socket.
$sock = IO::Socket::INET->new(PeerAddr => $self->server, PeerPort => $self->port, Proto => "tcp", );
I took this code, commented out the rest, and voila - it worked. I have no idea, why the author of Net::IRC used the gensym() approach and not the IO::Socket way.

Hope this helps.

P.S.: In my firewall logs I found out, that when I used the original Net::IRC, the irctest scripts tried to connect to the IRC-server with a local address of 127.0.0.1 - which of course can't work.

Replies are listed 'Best First'.
Re: Re: Net::IRC does not connect
by olly (Scribe) on Jul 31, 2001 at 16:14 UTC
    I am facing the same problem with Net::IRC but I am not entirely sure what to comment out, could you please upload either the file or send it to me at linuxlc@iname.com?

    Thanks in advance

    Imagination is more important then knowledge -Einstein-

      Sorry that I didn't reply earlier.

      In Net::IRC::Connection, there's a connect() sub, that has this piece of code:
      # my $sock = IO::Socket::INET->new(PeerAddr => $self->server, # PeerPort => $self->port, # Proto => "tcp", # ); $sock = Symbol::gensym(); unless (socket( $sock, PF_INET, SOCK_STREAM, getprotobyname('tcp') + )) { carp ("Can't create a new socket: $!"); $self->error(1); return; }
      Uncomment the upper part and comment out the part below, it should work then.
        Unfortunately Uncommenting the upper part and commenting out the lower does not help me here....
      Thanks for your reply anyway

      But I made the switch to POE::Component::IRC

      Imagination is more important then knowledge -Einstein-

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://77484]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (6)
As of 2022-12-01 08:03 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Notices?