I'm building a simple chat client and nothing happens when the client connects to the server, i think the thread is stopping on "while (message = in.readLine()) != null"
You are accessing the same variable from two unsynchronized contexts: the go() method, and the run() method. There's no guarantee that the in and out variables will be assigned a value before the second thread starts running.
i'm basing it on this code Head First Java in which run and setupnetworking() are two different methods sharing the variables reader and writer. Note IncomingReader() is an inner class.
Copying everything from go() into the thread run() still produces no output. I'm only running one thread.
Rob Brew wrote:i think the thread is stopping on "while (message = in.readLine()) != null"
That's quite possible. It would be waiting until it had received some data followed by some line-ending character. So if the other party is sending some data which doesn't have a line-ending character, your code would wait forever.
Just for clarity, I based my answer on an earlier version of the original post, where the problem was that a NullPointerException was being thrown, which implied the in variables was null, not the message.