Stephan van Hulst wrote:Well, I haven't really used memory mapped I/O so far, so I can't be sure, but maybe some of the methods of MappedByteBuffer can help you out.
If not, and this type of performance is really what you want, maybe it's best to write native code that handles IPC, and then use JNA to invoke these native methods.
Stephan van Hulst wrote:Yes, but he wants to detect failing peers, not peers that are finished with what they're doing.
James, there is no way you can do this in Java. You could write complex native code that checks whether you received TCP ACKs, if that is even possible, but it wouldn't be worth it.
Maybe what you can do is have some sort of heartbeat. At intervals send a message to a client and the client has to respond within a certain amount of time. This of course is not an elegant solution. And if your application already sends data regularly, sending an application level acknowledgment is roughly equivalent.
So you need to figure out for yourself whether you want to do these acknowledgments or not. You can still detect whether clients have dropped if you send data regularly, and the connection will just fail after a while. This should be good enough for statistics. If you want more security than that, you will have to use an ack mechanism.
Stephan van Hulst wrote:Hi James, welcome to CodeRanch!
I don't think you can. Is there a reason you want to do this anyway?
Campbell Ritchie wrote:Don’t know myself, but welcome to the Ranch