Getting 8 nulls in response to login

I am currently writing a twitch program in Java.

    socket = new Socket(SERVER, TWITCH_PORT);
    is = socket.getInputStream();
    os = socket.getOutputStream();
    inputStreamReader = new InputStreamReader(is, "UTF-8");
    outputStreamWriter = new OutputStreamWriter(os, "UTF-8");
    BufferedReader read = new BufferedReader(inputStreamReader);
    BufferedWriter writer = new BufferedWriter(outputStreamWriter);

    writer.write("PASS oauth:" + OAUTH);
    writer.write("NICK " + NICK);

    while(true) {
        String line = read.readLine();
        if(line != null) {

The program connects and then continues to receive a infinite amount of null responses. I am not sure what I did wrong? As the twitch API says I should recieve: 001 twitch_username :connected to TMI 002 twitch_username :your host is TMI 003 twitch_username :this server is pretty new 004 twitch_username 0.0.1 w n 375 twitch_username :- Message of the day - 372 twitch_username :- not much to say here 376 twitch_username :End of /MOTD command


Each IRC line/command must must end with an ASCII carriage return and linefeed (\r\n). Try fixing that and see if there is any change.

Thanks man that worked. Getting a error logging in response now though

Edit: nevermind fixed it thanks for the help!

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.