IRC Bot: Error - Registration Timeout

The.Anti.9 picture The.Anti.9 · Nov 27, 2008 · Viewed 10.2k times · Source

I'm making a simple IRC Bot in C. And I finally got the bot connecting and receiving information. My code is supposed to be sending as well, but the server is acting as if it is not sending anything. When The bot connects, I receive this:

Recieved: :roc.esper.net NOTICE AUTH :*** Looking up your hostname...

Recieved: :roc.esper.net NOTICE AUTH :*** Found your hostname

at which point my code sends this:

Sent: NICK Goo

Sent: USER Goo * * :Goo

I determined from using wireshark that this is the registration you should send after the initial connect. However, I'm not sure the data is actually sending or maybe it is invalid somehow? Because after about 30 seconds of nothing i also receive this:

Recieved: ERROR :Closing Link: c-68-33-143-182.hsd1.md.comcast.net (Registration timed out)

And then my program closes.

Does anyone else know anything about the programatic auth/registration processes in irc? Or does anyone else have any helpful ideas at all?

Thanks

** EDIT ** Fixed. I needed to be sending line terminators at the end of each line. \r\n

Answer

schnaader picture schnaader · Nov 27, 2008

Telnet for roc.esper.net:

~$ telnet roc.esper.net 6667
Trying 198.247.173.216...
Connected to roc.esper.net.
Escape character is '^]'.
:roc.esper.net NOTICE AUTH :*** Looking up your hostname...
:roc.esper.net NOTICE AUTH :*** Found your hostname
NICK Goo
USER Goo * * :Goo
PING :268966433
PONG :268966433

NICK, USER and PONG were send by me. After that, welcome message follows:

:roc.esper.net 001 Goo :Welcome to the EsperNet Internet Relay Chat Network Goo
:roc.esper.net 002 Goo :Your host is roc.esper.net[198.247.173.216/6667], running version esphyb-1.0.1

And so on...

So, again, check for PING-PONG and if your messages are sent correctly (especially CR/LF or '\n' at end).

By the way, I get "registration timed out" if I don't send any of the messages, even if PONG is missing, but once I answered PING, there is no timeout anymore (at least not after 30 seconds).