The connection seems to be okay, but the client doesn't seem to be reading anything correctly.
Once connected, the server sends a HELLO message. The client doesn't seem to acknowledge it until the server disconnects the client (or server is closed). After which it seems to arrive immediately, followed by disconnection.
I don't think its a problem with the server (which isn't android) because I have made a VB program that connects and works with it fine.
As far as I know, the code should work fine (I've done it before in desktop Java) and it's the same as any examples I can find on the internet...
If anyone could shed some light, I'd very much appreciate it
Using java Syntax Highlighting
- sock = new Socket(Finals.SERVER_HOST, Finals.SERVER_PORT);
- DataInputStream inputstream = new DataInputStream(sock.getInputStream());
- Log.v("act", "socket open");
- String received;
- while((received = inputstream.readLine()) != null) {
- Log.v("act", "received");
- parseIncoming(received);
- }
Parsed in 0.031 seconds, using GeSHi 1.0.8.4

