I’m writing a IRC client in c# and I always get “No ident response” message and the it just disconnects.
Code
TcpClient client = new TcpClient(args[0], port);
sock.Connect(serverEndPoint);
NetworkStream stream = client.GetStream();
NetworkStream streamw = client.GetStream();
System.IO.StreamReader reader = new System.IO.StreamReader(stream);
System.IO.StreamWriter writer = new System.IO.StreamWriter(streamw);
writer.WriteLine("loaloaloa");
IPEndPoint rep = (IPEndPoint)sock.LocalEndPoint;
while (true)
{
string bytes = reader.ReadLine();
Console.WriteLine("Received: {0}", bytes);
if (String.IsNullOrEmpty(bytes))
break;
}
Here’s the message
:kornbluth.freenode.net NOTICE * :*** Looking up your hostname...
:kornbluth.freenode.net NOTICE * :*** Checking Ident
:kornbluth.freenode.net NOTICE * :*** Found your hostname
:kornbluth.freenode.net NOTICE * :*** No Ident response
ERROR :Closing Link: 127.0.0.1 (Connection timed out)
I figured out that i have to listen on port 113 to get a message and then respond with the same message and little bit more info.
So my question is how do i start listening on port 113, and how would i accept the message and responde?.
as @Miserable_Variable already linked to, you need an ident service running on tcp:113
on that port you will receive a connection from the IRCd that will give you something like
“xxxxx, 6667” where xxxxx is the portnumber of the IRC connection on your side and obviously 6667 is the portnumber on the side of the IRCd …
if you reply with “xxxxx, 6667 : USERID : UNIX : yyyyy” where yyyyy stands for your username and xxxxx for the requested port number, the IRCd should accept your connection (unless you caught yourself a ban …)