i am working on a twitch chat statistics bot (in java), and got a small problem with the connection.
how should the response pong look like? and to which server should it send to?
atm i am opening a Socket connection to irc.twitch.tv.
socket = new Socket(irc.twitch.tv, 6667);
Joining the chat and everything works fine, i just get time out after i received the second PING.
atm my response pong looks like this:
sender is a BufferedWriter with a OutputstreamWriter bound to the socket:
sender = new BufferedWriter(new OutputStreamWriter(socket.getOutputStream()));
Also, this should only be in the event of a PING messages. You need to listen to the socket in a BufferedReader and respond with an appropriate pong message (the same trailing characters as you received). I believe you need to be sending “PONG :tmi.twitch.tv”, but this should be generated from the message received, as in the linked example.