I’m writing a socket server in python. It needs to send acknowledgement to the client module. Quote from the protocol description:
“[…]server should determine if it would accept data from this
module. If yes server will reply to module 01 if not 00.”
I implemented this in python as:
connection.send('01')
It isn’t working, so I checked the java implementation of the server:
byte[] answer = {
0x01};
out.write(answer);
out.flush();
I wonder whether it’s the same or not?
The System.out.write(answer); doesn’t seem to output a thing to the console.
You’re sending two bytes,
0x30followed by0x31, whereas the Java code is sending just one byte,0x01.Try the following instead:
In case you’re wondering where the
0x30and0x31came from, they are ASCII codes for the characters'0'and'1'.