S
Saptarshi
Hello,
My server, written in C has some command sequences. For example to get
it to evaluate a string and return some data, the client must send
(where dop is the sockets dataoutputstream). (The server reads ands
ends Big endian)
dop.writeInt(RConnection.CMD_EVAL);
dop.writeInt(expression.length());
dop.writeBytes(expression);
dop.flush();
the client then reads,
int serlen = dip.readInt();
byte[] b = new byte[serlen];
dip.read(b);
and b now contains the data. However, there might be some info
messages too, so the client then reads
(*) int k = dip.readInt(). //corresponds to the length of the info
string that wil be sent.
On the C side, when it attempts to write the int for (*) to read, the
write command returns -1 and ERRNO is 32 (EPIPE). Also, the value of
k, is some number fixed across sessions but nothing like the original.
e.g when the int that the server will write is: 0 0 0 e (big
endian), the client has read 85 1 0 0. However, the value in 'b' is
correct.
The python client does not have any problems. It is the Java one that
troubles me.
The socket has no options and this is TCP/IP on the same machine (OS X
10.5, Java 1.5)
Thank you for your time
Saptarshi(please could you cc to (e-mail address removed))
My server, written in C has some command sequences. For example to get
it to evaluate a string and return some data, the client must send
(where dop is the sockets dataoutputstream). (The server reads ands
ends Big endian)
dop.writeInt(RConnection.CMD_EVAL);
dop.writeInt(expression.length());
dop.writeBytes(expression);
dop.flush();
the client then reads,
int serlen = dip.readInt();
byte[] b = new byte[serlen];
dip.read(b);
and b now contains the data. However, there might be some info
messages too, so the client then reads
(*) int k = dip.readInt(). //corresponds to the length of the info
string that wil be sent.
On the C side, when it attempts to write the int for (*) to read, the
write command returns -1 and ERRNO is 32 (EPIPE). Also, the value of
k, is some number fixed across sessions but nothing like the original.
e.g when the int that the server will write is: 0 0 0 e (big
endian), the client has read 85 1 0 0. However, the value in 'b' is
correct.
The python client does not have any problems. It is the Java one that
troubles me.
The socket has no options and this is TCP/IP on the same machine (OS X
10.5, Java 1.5)
Thank you for your time
Saptarshi(please could you cc to (e-mail address removed))