I was attempting to communicate to a device server with Sockets, after having my little Java program hang when on readLine
I ended up having to inject my target application with a packet sniffer and found out that os.writeBytes("notify\n");
was being split to two packets, the first containing n
and the next otify
, of which the server did not like. I fixed this by adding another writeBytes
before hand:
os.writeBytes(" ");
os.writeBytes("notify\n");
os.flush();
This to me seems a bit hacky and potentially unstable, could someone shed some light why I'm having to do this and give me a better solution.
Cheers