Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

socket adapter connecting to Java Server

Status
Not open for further replies.

tomdiver

Programmer
Jul 19, 2006
1
US
I am trying to pass data to a java server through the socket adapter and the trace files shows data being sent, but the server is not receiving it. The map does connect on the server port but does not receive the data.

Trace file:

<2728-2976>: Host 127.0.0.1 port 3456 ... socket number 13040
<2728-2976>: Putting message ...
<2728-2976>: Message type:ISIZED
<2728-2976>: 18 bytes passed by the engine
<2728-2976>: 18 bytes send out of 18

<2728-2976>: Put, exit: Wed Jul 26 11:38:33 2006


<2728-2976>: Reading message from socket number 13040
<2728-2976>: Reading message from socket number 13040 (message type = sized)
<2728-2976>: 0 messages succesfully read from socket

<2728-2976>: Get, exit: Wed Jul 26 11:38:33 2006


<2728-2976>: Disconnect: Wed Jul 26 11:38:36 2006


<2728-2976>: reference number 1 for socket 13040
<2728-2976>: Disconnecting from 127.0.0.1 port 3456 ... socket number 13040
<2728-2976>: Disconnect, exit: Wed Jul 26 11:38:36 2006

Second, I send back a simple msg back, after connection is made and the map shows no data being received.

My command is:

=GET("SOCKET","-HOST 127.0.0.1 -PORT 3456 -CCON SHARED -T+ -ISIZED ",PACKAGE(out1) )

where out1 is the data from card 1 I am sending.

I am using Merc 6.7.1.

Any help would be appreciated.

Tom
 
Hi Tom,

I think you should be using "-CCON EXCL", you probably want the connection to close after reading a message.

Also, have you got a sample of the data you expect back? The first four bytes must be the length of the result and it must be in binary (i.e. not ASCII).

Cheers,
Olly.
 
Can you run the socket example?


BocaBurger
<===========================||////////////////|0
The pen is mightier than the sword, but the sword hurts more!
 
Hi OllyC,

I tried your recommendation of -ccon excl and it works!

Also, I was truncating 2 of the 4 length bytes

therefore it was sending 2 ascii chars as length.

Thanks for the quick repsonse.


Tom
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top