B4J Question [RESOLVED] Kill Javaw Process


Well-Known Member
Licensed User
Longtime User
Hello All,

I have an B4J app that as B4A client connected to it using sockets. If the kill the process using the IDE Kill process button or from windows resource manager the B4A clients cannot detect that the sockets are no longer valid.

If I exit the B4J app and do the formal closing everything is ok. It there a way of detecting the B4J app is being closed I and can formally close the sockets.

The B4A apps send a 'ping packet' every 30 seconds, so, in the meantime I will have to implement some sort of packet ack to overcome this. The B4A app checks the socket state frequently but is always returns a connected state of TRUE.

Any ideas ?




B4X founder
Staff member
Licensed User
Longtime User
When the B4J app is killed from task manager (or IDE) it is killed immediately. Nothing can be executed at that point.

I think that the most reliable way will be to periodically send a PING request and if a response doesn't arrive in x seconds then the connection is broken.

All of this assuming that you need to maintain an active connection. If not then it can be much simpler.
Upvote 0