Out-of-band Java sockets

Does anyone know how to get (how to find out what you got) out-of-band data with Java sockets? In particular, I read the documentation for sendUrgentData and setOOBInline , which states that:

Note. Limited support is provided for processing incoming urgent data. In particular, notification of incoming urgent data is not provided, and it is not possible to distinguish between normal data and urgent data if they are not provided by a higher-level protocol.

But I still hope someone has a solution :-)

More details:

I send serialized objects via a socket, and I don’t see how I can find the “random” byte OOB inserted into the stream (except that Java will give me an exception when I try to deserialize the object).

+5
source share
2 answers

Tomcat has a supported JNI socket implementation that can read urgent packets in OOB fashion.

+2
source

It is similar to Java, right up to Java 6 (I did not research Java 7 because I don’t know if they decided what will happen next or not), and it seems that Java does not provide any support whatsoever for reading urgent TCP information in out-of-band mode . And it looks like it's a deliberate choice, so far.

, , , JNI, . JDK. ! .:) , , .

+2

All Articles