IRC Bot: Error - Registration Timeout
Asked Answered
T

3

6

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

Trevor answered 27/11, 2008 at 8:7 Comment(0)
G
4

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).

Gigot answered 27/11, 2008 at 8:49 Comment(0)
B
2

Try sending the USER command before the NICK command. What IRC network are you trying to connect to?

"
> telnet irc.freenode.net 6667
NOTICE AUTH :*** Looking up your hostname...
NOTICE AUTH :*** Checking ident
NOTICE AUTH :*** No identd (auth) response
NOTICE AUTH :*** Couldn't look up your hostname
USER x x x x
NICK hwjrh
:kubrick.freenode.net 001 hwjrh :Welcome to the freenode IRC Network hwjrh
:kubrick.freenode.net 002 hwjrh :Your host is kubrick.freenode.net[kubrick.freenode.net/6667], running version hyperion-1.0.2b
"

Works for me; I telnet to Freenode, Undernet and Dalnet all the time...

Brister answered 27/11, 2008 at 8:29 Comment(4)
Yep, same here, even for roc.esper.net, but after sending NICK you get a PING you have to answer. After that, everything runs fineGigot
it's not working for me still. It's still doing what it was doing before. And I'm not getting a PING. It just times out.Trevor
Perhaps something is wrong with your messages. Do you send a CR/LF at the end of those, too? If possible, try telnet, too, so you can see if even this fails for you.Gigot
schnaader made a good point. Try sending CR or LF or CR/LF at the end of the line.Brister
G
1

From the tutorials I looked at (like this one), it seems that you are doing it right, except that this

USER Goo * * :Goo

is

USER Goo 0 * :Goo

in all the tutorials I saw. Also, don't forget the PING-PONG later on, but this should not be needed for registration (EDIT: It seems that this is wrong and PONG is needed right after you send NICK).

I guess you know about RFC 1459, which will also help you a lot with this.

Gigot answered 27/11, 2008 at 8:17 Comment(1)
Do you check for PINGs? There seems to be that error message if you do not PONG in registration, also.Gigot

© 2022 - 2024 — McMap. All rights reserved.