Forums Register Login

Java Socket buffering problem and nonblocking

+Pie Number of slices to send: Send
Im a fresher, i dnt have experience in java
Currently im handling one project wchich is device based implementing in java(USING TCP/IP socket).

Simultaneously i wan't send commands to the device.

But while implementing concept with nonblocking socket(SocketChannel) im not receiving complete packets from that device or sometimes receiving but it returns proper values with some extra characters.

I don't know how to handle buffering for socket which im receiving from device (the deivce can return any no. of bytes at a time).


But device working system like this if i will send command to device it sends complete information.

How to implement properly can anyone help me.....
+Pie Number of slices to send: Send
This is probably not the best forum for a Java socket problem ;-)

... when doing socket stuff I now always find an appropriate framework and use that, rather than do the really low level stuff myself as there are far better experts at such things.

Why not search the net for an open source framework there are several what about ApacheMina (plenty of others), get it working in that if you can't use open source for whatever reason, their source code is freely available and usually well written to give you some tips as to where your going wrong.
Whatever. Here's a tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 1389 times.
Similar Threads
Handle large process by Maintain status in presentation
java.io.IOException: Broken pipe
c# socket and java socket
JavaFX inWM6.5 / Download a file from internet
applet to IIS via sockets
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 29, 2024 02:59:07.