I have a GSM device that uses GPRS and communicate with a B4J server using TCP socket.
When the device want to close communication and shut down, which is the correct way to manage sockets and Atream ?
Actually the device just close its socket, terminate GPRS connection and shut down.
Normally the server recognize this and terminate also socket and astream by itself, but sometimes I need to wait a long timeout before this happens.
So I wonder if it is better the device, before it shut down, send a command like "closeAll" to tell the server to close immediately everything.
I'm trying to implement this and when the server receive the command execute an "Astream.Close" but this generate some errors.
When the device want to close communication and shut down, which is the correct way to manage sockets and Atream ?
Actually the device just close its socket, terminate GPRS connection and shut down.
Normally the server recognize this and terminate also socket and astream by itself, but sometimes I need to wait a long timeout before this happens.
So I wonder if it is better the device, before it shut down, send a command like "closeAll" to tell the server to close immediately everything.
I'm trying to implement this and when the server receive the command execute an "Astream.Close" but this generate some errors.