Q
Q
Quad_Tree2016-06-25 22:12:14
Java
Quad_Tree, 2016-06-25 22:12:14

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();
        }
    }

But I can't connect to the server in any way:
b0bc5e933adf49cd91b4a26251e80cc6.png
What am I doing wrong?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
X
xmoonlight, 2016-06-25
@Quad_Tree

https://en.wikipedia.org/wiki/Ident

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question