[sip-comm-dev] Losing connection detection


#1

I was working on this issue now and i noticed several things.
First - on linux there is no info coming to the socket that the connection is reset or the cable is unplugged.
I've tested this not only with Sip-Comm but with other clients the situation is the same.
Then I've tested this on windows. There the situation is different.
When the cable is unplugged there is an exception from the socket and when there is no Internet connectivity
there is also triggered an event. But this event is after some activity from the user. And this is a good reason a keepalive packet to be used.
I will look for this feature I saw it in the protocol, The official ICQ clients use it.

Here goes the interesting part, which is addressed to yana :))
The event isn't handled properly in the gui :)) It stays as you are online. I will create an issue.

Here are the proofs for the proper event dispatching in the Sip-Comm (but not in the gui).
Here is first the exception.

    [java] 116110 INFO: net.kano.joustsim.oscar.ExternalServiceManager.connStateChanged() External service connection died for service 16 ( net.kano.joustsim.oscar.ExternalServiceManager$ServiceRequestInfo@25491d)
     [java] 116110 INFO: net.kano.joustsim.oscar.ExternalServiceManager.requestService() Requesting external service 16 for net.kano.joustsim.oscar.oscar.service.icon.IconServiceArbiter@278e83
     [java] 116110 WARNING: net.kano.joscar.net.logException() CONNPROCESSOR HAS NO ERROR HANDLERS, DUMPING:
     [java] ERROR TYPE: ERRTYPE_CONNECTION_ERROR
     [java] ERROR INFO: null
     [java] java.net.SocketException: Connection reset by peer: socket write error
     [java] at java.net.SocketOutputStream.socketWrite0(Native Method)
     [java] at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:92)
     [java] at java.net.SocketOutputStream.write(SocketOutputStream.java:136)
     [java] at net.kano.joscar.ByteBlock.write(Unknown Source)
     [java] at net.kano.joscar.flap.FlapProcessor.sendFlap(Unknown Source)
     [java] at net.kano.joscar.snac.AbstractSnacProcessor.sendSnac(Unknown Source)
     [java] at net.kano.joscar.snac.ClientSnacProcessor.sendSnacImmediately(Unknown Source)
     [java] at net.kano.joscar.snac.ImmediateSnacQueueManager.sendSnac(Unknown Source)
     [java] at net.kano.joscar.snac.ImmediateSnacQueueManager.queueSnac(Unknown Source)
     [java] at net.kano.joscar.snac.ClientSnacProcessor.sendSnac(Unknown Source)
     [java] at net.kano.joustsim.oscar.oscar.OscarConnection.sendSnacRequest(OscarConnection.java:325)
     [java] at net.kano.joustsim.oscar.oscar.service.Service.sendSnacRequest(Service.java:140)
     [java] at net.kano.joustsim.oscar.oscar.service.bos.MainBosService.requestService(MainBosService.java:173)
     [java] at net.kano.joustsim.oscar.ExternalServiceManager.requestService(ExternalServiceManager.java:301)
     [java] at net.kano.joustsim.oscar.ExternalServiceManager.refreshServiceIfNecessary(ExternalServiceManager.java:206)
     [java] at net.kano.joustsim.oscar.ExternalServiceManager.access$800(ExternalServiceManager.java:67)
     [java] at net.kano.joustsim.oscar.ExternalServiceManager$ExternalServiceConnListener.connStateChanged(ExternalServiceManager.java:393)
     [java] at net.kano.joustsim.oscar.oscar.OscarConnection.stateChanged(OscarConnection.java:238)
     [java] at net.kano.joustsim.oscar.oscar.OscarConnection.access$300(OscarConnection.java:78)
     [java] at net.kano.joustsim.oscar.oscar.OscarConnection$4.stateChanged(OscarConnection.java:164)
     [java] at net.kano.joscar.net.ClientConn.setState(Unknown Source)
     [java] at net.kano.joscar.net.ClientConn.processError(Unknown Source)
     [java] at net.kano.joscar.net.ClientConn$ConnectionThread.run(Unknown Source)
     [java] 116172 FINE: impl.protocol.icq.ProtocolProviderServiceIcqImpl.handleStateChange() ICQ protocol provider ICQ changed registration status from ONLINE to DISCONNECTED
     [java] 116172 FINE: impl.protocol.icq.ProtocolProviderServiceIcqImpl.handleStateChange() The aim Connection was disconnected!
     [java] 116172 FINE: impl.protocol.icq.ProtocolProviderServiceIcqImpl.fireRegistrationStateChanged() Dispatching RegistrationStateChangeEvent[ oldState=Unregistered;newState=RegistrationState=Unregistered] to 4 listeners.
     [java] 116172 FINE: impl.protocol.icq.OperationSetPersistentPresenceIcqImpl.registrationStateChanged() The ICQ provider changed state from: RegistrationSta
te=Unregistered to: RegistrationState=Unregistered
     [java] 116172 FINE: impl.protocol.icq.OperationSetBasicInstantMessagingIcqImpl.registrationStateChanged() The ICQ provider changed state from: RegistrationState=Unregistered [java] 116188 FINE: impl.protocol.icq.OperationSetTypingNotificationsIcqImpl.registrationStateChanged() The ICQ provider changed state from: RegistrationState=Unregistered [java] 116188 FINER: impl.protocol.icq.ProtocolProviderServiceIcqImpl.fireRegistrationStateChanged() Done.

And here when there is no connectivity just the events

[java] 904735 INFO: net.kano.joustsim.oscar.ExternalServiceManager.connStateChanged() External service connection died for service 16 ( net.kano.joustsim.oscar.ExternalServiceManager$ServiceRequestInfo@1fcf790)
     [java] 904735 INFO: net.kano.joustsim.oscar.ExternalServiceManager.requestService() Requesting external service 16 for net.kano.joustsim.oscar.oscar.service.icon.IconServiceArbiter@fd66a5
     [java] 904735 FINE: impl.protocol.icq.ProtocolProviderServiceIcqImpl.handleStateChange() ICQ protocol provider ICQ changed registration status from ONLINEto DISCONNECTED
     [java] 904735 FINE: impl.protocol.icq.ProtocolProviderServiceIcqImpl.handleStateChange() The aim Connection was disconnected!
     [java] 904735 FINE: impl.protocol.icq.ProtocolProviderServiceIcqImpl.fireRegistrationStateChanged() Dispatching RegistrationStateChangeEvent[ oldState=Unregistered; newState=RegistrationState=Unregistered] to 4 listeners.
     [java] 904735 FINE: impl.protocol.icq.OperationSetPersistentPresenceIcqImpl.registrationStateChanged() The ICQ provider changed state from: RegistrationState=Unregistered to: RegistrationState=Unregistered
     [java] 904735 FINE: impl.protocol.icq.OperationSetBasicInstantMessagingIcqImpl.registrationStateChanged() The ICQ provider changed state from: Registration
State=Unregistered to: RegistrationState=Unregistered
     [java] 904735 FINE: impl.protocol.icq.OperationSetTypingNotificationsIcqImpl.registrationStateChanged() The ICQ provider changed state from: RegistrationSt
ate=Unregistered to: RegistrationState=Unregistered
     [java] 904735 FINER: impl.protocol.icq.ProtocolProviderServiceIcqImpl.fireRegistrationStateChanged() Done.

···

to:RegistrationState=Unregistered

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@sip-communicator.dev.java.net
For additional commands, e-mail: dev-help@sip-communicator.dev.java.net


#2

Hi Damian,

Damian Minkov wrote:

Here goes the interesting part, which is addressed to yana :))
The event isn't handled properly in the gui :)) It stays as you are online. I will create an issue.

Yeah, you're right. When I wrote this there were states which were not very clear to me. I left them unimplemented and I meant to come back on this later. I see that the moment has come:) Thanks for the issue:)

Regards,
Yana

···

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@sip-communicator.dev.java.net
For additional commands, e-mail: dev-help@sip-communicator.dev.java.net