The server I put was a server running on IRC's EFNet network. I was supposed to receive a message, from the server, right? Not only this doesn't happen, my program also crashes without showing anything! (the debugger comes up with no explanation).

Any ideas why? Actually, I must have made a newbie mistake due to my ignorance. Please enlighten me.

macrumors 6502

I don't know much about the IRC protocol, but perhaps the server is closing the connection since you aren't sending anything to it? Don't most IRC servers have a PNG/QNG (ping/pong) challenge system to see if you're still there?

macrumors 68040

[*]what do the last lines mean (about ident responce)
[*]why did the connection close by iself?
[*]What am I supposed to read in order to get this done (if not already covered into the IRC specification)
[*]some people tell me about telnet... What is this? I read the wikipedia article and I must admit I don't understand much...
[/LIST]

Click to expand...

The last lines mean the server is rejecting the connection because it can't identify you (the identd issue).

The connection closed because the server terminated it when it was unable to identify you.

Other posters have pointed to sources of ident information, this is what I would look at next. This leads into your last question, you can try:
telnet localhost 113
from the terminal and see if you get a reply. if you do, and you do have your router forwarding TCP port 113 to the IP of your machine, the remote server should be OK with getting your ident that way.

The other use for telnet in this case is to evaluate what the server will send, test your responses, etc.

You can run:
telnet efnet.teleglobe.net 6667
And this will open a connection to the server you are trying to connect to with your program. From here you can enter commands and see what the server's response is. this gives you an easy means of validating what you need to listen for in your program and what the appropriate replies are without constantly modifying your program.

Take a look at ident and see if you can get that going first. That seems to be the primary stumbling block right now.

macrumors regular

I had the same problem... after you connect, you then need to send two thing to the server...

Quote

NICK MyWayCoolBotNick\r\n
USER ObjcBot 8 * :The Objective-C Bot\r\n

Click to expand...

Or something like that... as I recall thats where the server stopped caring about my connection and terminated me. the next thing you would need to do is reply to ping messages, otherwise the server will get mad at you:

thread startermacrumors 68000

I had the same problem... after you connect, you then need to send two thing to the server...

Or something like that... as I recall thats where the server stopped caring about my connection and terminated me. the next thing you would need to do is reply to ping messages, otherwise the server will get mad at you:

Don't forget to join a channel!

Click to expand...

Thanks a lot! That seemed to have fixed the problem! I connected using the terminal! Now all I have to do is the rest (build the program).

lee1210, thanks a lot. i ran the command you gave me into the terminal, and then it worked. However, the ident could not be resolved.

thread startermacrumors 68000

I had the same problem... after you connect, you then need to send two thing to the server...

Or something like that... as I recall thats where the server stopped caring about my connection and terminated me. the next thing you would need to do is reply to ping messages, otherwise the server will get mad at you:

Don't forget to join a channel!

Click to expand...

OK, I managed to do this using the terminal, but there is still something I miss.

With the command "telnet efnet.teleglobe.net 6667" I get to open a telnet communication with the server. The same thing happens when I use the connect() function in C++. But afterwards, how can I send those 2 commands I need (NICK and USER) using C++? In the terminal, typing

Code:

NICK MyWayCoolBotNick\r\n
USER ObjcBot 8 * :The Objective-C Bot\r\n

is sufficient. But in C++, I try to use the send() command but with no effect. What am I doing wrong?

macrumors 68040

And I am just getting terminated. This is my output log:
<clip>
Just this. How can I verify what I am sending using tcpdump?

Click to expand...

I would move the two send statements with the nick and user BEFORE the first input loop.

I realize that I lead you astray on this point with the reading until numbytes is 0, because I wasn't totally sure what the protocol was like. Essentially you'll stay in that loop until the server disconnects you and there is nothing left to read (I believe).

If you send nick and user first, what you get back from the server should be a welcome message, etc. Afterwards you should be able to send your join command.

This is where experimenting with telnet should come in handy, because you can see what to send to the server and when, and what its responses will be.

I can't comment too much on tcpdump, but if you were to use it you would likely only want to listen to connections to the efnet server on the port you are using, so you only see the tcp activity from your program. If you don't have a filter like this you will probably have a very hard time viewing the output because it will be full of other tcp communications to and from your computer.

I noticed something strange, though. If I send the commands about the NICK and USER, I will get nothing. Else, I get the correct result (the correct response from the server). Why does this happen? I mean, is it not the same?

MacRumors attracts a broad audience
of both consumers and professionals interested in
the latest technologies and products. We also boast an active community focused on
purchasing decisions and technical aspects of the iPhone, iPod, iPad, and Mac platforms.