Ok, I have experiment a lot and found that :
When the Java Server use :
in = requestSocket.getInputStream();
It works… I can read what the Ruby socket is sending…
But the real Java server that I have to talk with use :
in = new ObjectInputStream( new BufferedInputStream(
requestSocket.getInputStream() ) );
And in this case I get :
java.io.StreamCorruptedException: invalid stream header
The client can’t change the server so…
Is there a mean to force a header in a way that the ObjectInputStream
will be able to read what I send from Ruby ?
Here’s my test Ruby code :
addrinfo = Socket::getaddrinfo('localhost', 9501, nil,
addrinfo.each do |af, port, name, addr|
sock = TCPSocket.new(addr, port)
Thx in advance !
Serge S. wrote:
I have some problem trying to establish dialog between a Ruby
socket(client) and a Java server socket (java.net.ServerSocket).
Everytime I try to write on the server socket I get an “Invalid stream
header” error from the server…
s = TCPSocket.open(“host”, 9061)
Can someone give a little hint on how to start inthe right way on this ?
Thx a lot !