You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@etch.apache.org by Aa...@partner.bmw.de on 2013/03/26 13:55:31 UTC

Get notified of session / connection status (SessionNotify)

Hey there,

I was wondering, if there is a possibility to track you current connection. In the C-Binding it was possible to get the "onSessionNotify" event.
Of course i would get an exception as soon as i try to send a message to a already closed connection but it would be nice to get notified when e.g. the connection was lost.

How is this handled in the CPP-Binding or the Java-Binding?

Kind regards,
Aaron

Re: Get notified of session / connection status (SessionNotify)

Posted by Scott Comer <we...@mac.com>.
The java binding handles that with session listeners. See the chat example.

Sent from my iPhone

On Mar 26, 2013, at 7:55 AM, Aaron.Frueh@partner.bmw.de wrote:

> Hey there,
> 
> I was wondering, if there is a possibility to track you current connection. In the C-Binding it was possible to get the "onSessionNotify" event.
> Of course i would get an exception as soon as i try to send a message to a already closed connection but it would be nice to get notified when e.g. the connection was lost.
> 
> How is this handled in the CPP-Binding or the Java-Binding?
> 
> Kind regards, 
> Aaron 

Re: Get notified of session / connection status (SessionNotify)

Posted by Aa...@partner.bmw.de.
Thanks Martin,


I will check the Patch as soon as possible and let you know.

Regards,
Aaron

Am 27.03.13 23:30 schrieb "Martin Veith" unter <Ma...@bmw-carit.de>:

>Hi Aaron,
>
>in the CPP binding the forwarding of session events to the user code has
>not been implemented yet. There was a TODO for that in EtchStubBase class.
>
>I compiled a quick patch (0001-ETCH-267) for that which forwards only the
>sessionNotify events. In the patch 0002 I have shown how to use it in the
>HelloWorld example.
>I'm going to write a "nicer" patch (which forwards every event and does
>some more checks) and commit it asap.
>
>Let us know if the patches solve your problem.
>
>Regards,
>Martin
>
> 
>
>On Mar 26, 2013, at 7:55 AM, Aaron.Frueh@partner.bmw.de wrote:
>> Hey there,
>>
>> I was wondering, if there is a possibility to track you current
>>connection. In the C-Binding it was possible to get the
>>"onSessionNotify" event.
>> Of course i would get an exception as soon as i try to send a message
>>to a already closed connection but it would be nice to get notified when
>>e.g. the
>> connection was lost.
>>
>> How is this handled in the CPP-Binding or the Java-Binding?
>>
>> Kind regards, 
>> Aaron 


RE: Get notified of session / connection status (SessionNotify)

Posted by Martin Veith <Ma...@bmw-carit.de>.
Hi Aaron,

in the CPP binding the forwarding of session events to the user code has not been implemented yet. There was a TODO for that in EtchStubBase class.

I compiled a quick patch (0001-ETCH-267) for that which forwards only the sessionNotify events. In the patch 0002 I have shown how to use it in the HelloWorld example.
I'm going to write a "nicer" patch (which forwards every event and does some more checks) and commit it asap.

Let us know if the patches solve your problem.

Regards,
Martin

 

On Mar 26, 2013, at 7:55 AM, Aaron.Frueh@partner.bmw.de wrote:
> Hey there,
>
> I was wondering, if there is a possibility to track you current connection. In the C-Binding it was possible to get the "onSessionNotify" event.
> Of course i would get an exception as soon as i try to send a message to a already closed connection but it would be nice to get notified when e.g. the
> connection was lost.
>
> How is this handled in the CPP-Binding or the Java-Binding?
>
> Kind regards, 
> Aaron 

RE: Get notified of session / connection status (SessionNotify)

Posted by Martin Veith <Ma...@bmw-carit.de>.
I forgot to mention that I have attached the patches to issue ETCH-267 [1]

[1] https://issues.apache.org/jira/browse/ETCH-267

Martin Veith wrote on 2013-03-27:
> Hi Aaron,
> 
> in the CPP binding the forwarding of session events to the user code 
> has not been implemented yet. There was a TODO for that in EtchStubBase class.
> 
> I compiled a quick patch (0001-ETCH-267) for that which forwards only 
> the sessionNotify events. In the patch 0002 I have shown how to use it 
> in the HelloWorld example.
> I'm going to write a "nicer" patch (which forwards every event and 
> does some more checks) and commit it asap.
> 
> Let us know if the patches solve your problem.
> 
> Regards,
> Martin
> 
> 
> 
> On Mar 26, 2013, at 7:55 AM, Aaron.Frueh@partner.bmw.de wrote:
>> Hey there,
>> 
>> I was wondering, if there is a possibility to track you current 
>> connection. In the C-Binding it was possible to get the 
>> "onSessionNotify" event. Of course i would get an exception as soon 
>> as i try to send a message to a already closed connection but it 
>> would be nice to get notified when e.g. the connection was lost.
>> 
>> How is this handled in the CPP-Binding or the Java-Binding?
>> 
>> Kind regards,
>> Aaron


RE: Get notified of session / connection status (SessionNotify)

Posted by Martin Veith <Ma...@bmw-carit.de>.
I forgot to mention that I have attached the patches to issue ETCH-267 [1]

[1] https://issues.apache.org/jira/browse/ETCH-267

Martin Veith wrote on 2013-03-27:
> Hi Aaron,
> 
> in the CPP binding the forwarding of session events to the user code 
> has not been implemented yet. There was a TODO for that in EtchStubBase class.
> 
> I compiled a quick patch (0001-ETCH-267) for that which forwards only 
> the sessionNotify events. In the patch 0002 I have shown how to use it 
> in the HelloWorld example.
> I'm going to write a "nicer" patch (which forwards every event and 
> does some more checks) and commit it asap.
> 
> Let us know if the patches solve your problem.
> 
> Regards,
> Martin
> 
> 
> 
> On Mar 26, 2013, at 7:55 AM, Aaron.Frueh@partner.bmw.de wrote:
>> Hey there,
>> 
>> I was wondering, if there is a possibility to track you current 
>> connection. In the C-Binding it was possible to get the 
>> "onSessionNotify" event. Of course i would get an exception as soon 
>> as i try to send a message to a already closed connection but it 
>> would be nice to get notified when e.g. the connection was lost.
>> 
>> How is this handled in the CPP-Binding or the Java-Binding?
>> 
>> Kind regards,
>> Aaron


RE: Get notified of session / connection status (SessionNotify)

Posted by Martin Veith <Ma...@bmw-carit.de>.
Hi Aaron,

in the CPP binding the forwarding of session events to the user code has not been implemented yet. There was a TODO for that in EtchStubBase class.

I compiled a quick patch (0001-ETCH-267) for that which forwards only the sessionNotify events. In the patch 0002 I have shown how to use it in the HelloWorld example.
I'm going to write a "nicer" patch (which forwards every event and does some more checks) and commit it asap.

Let us know if the patches solve your problem.

Regards,
Martin

 

On Mar 26, 2013, at 7:55 AM, Aaron.Frueh@partner.bmw.de wrote:
> Hey there,
>
> I was wondering, if there is a possibility to track you current connection. In the C-Binding it was possible to get the "onSessionNotify" event.
> Of course i would get an exception as soon as i try to send a message to a already closed connection but it would be nice to get notified when e.g. the
> connection was lost.
>
> How is this handled in the CPP-Binding or the Java-Binding?
>
> Kind regards, 
> Aaron