Answer the question
In order to leave comments, you need to log in
Why can't I connect to an IRC server?
I wrote a Java IRC client:
public IRC(String server, int port) {
try {
// Создаём сокет для общения с сервером
Logger.print("Connecting to " + server + ":" + port + "...");
socket = new Socket(server, port);
BufferedReader br = new BufferedReader(new InputStreamReader(socket.getInputStream()));
BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(socket.getOutputStream()));
// Потоки входа и выхода
Logger.print("Creating input thread and output thread...");
Thread producer = new Thread(new Producer(bw));
Thread consumer = new Thread(new Consumer(br));
bw.write("NICK nickname");
bw.write("USER nickname 8 * :Real name");
bw.write("JOIN #ubuntu-ru");
bw.flush();
producer.setDaemon(true);
consumer.setDaemon(true);
producer.start();
consumer.start();
} catch (IOException e) {
e.printStackTrace();
}
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question