I am currently working on a IRC client written in Java.
As soon as the connection to the server is established I send these messages:
- /NICK test
- /JOIN #chat
The first tests went pretty well - the server is responding. But every time it says:
- NOTICE AUTH :***
- Checking Ident
- NOTICE AUTH :***
- No Ident response
- ERROR :Closing Link ... (Registration timed out)
I found a related question that helped a little bit. It says I need to listen on port 113 for a connection and a message to receive and respond to from the IRC-Server. I implemented a ServerSocket that listens on that port, but the server doesn't try to open a connection on port 113. What am I doing wrong?
Heres the code:
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.net.ServerSocket;
import java.net.Socket;
public class IdentProtocolThread extends Thread {
private String nick;
private ServerSocket serverSocket;
private BufferedReader reader;
private BufferedWriter writer;
public IdentProtocolThread(String nick) throws IOException {
this.nick = nick;
this.serverSocket = new ServerSocket(113);
}
@Override
public void run() {
try {
System.out.println("waiting for incoming socket");
Socket socket = this.serverSocket.accept();
System.out.println("socket accepted");
this.initialize(socket);
System.out.println("reader/writer initialized");
String line = null;
while ((line = this.reader.readLine()) != null) {
System.out.println(line);
}
} catch (IOException e) {
e.printStackTrace();
}
System.out.println("done");
}
private void initialize(Socket socket) throws IOException {
this.reader = new BufferedReader(new InputStreamReader(socket.getInputStream()));
this.writer = new BufferedWriter(new OutputStreamWriter(socket.getOutputStream()));
}
}
On execution I only get this displayed:
waiting for incoming socket
Do I need to send some other messages to avoid the ident check?