2007/11/6, Ge@@ru <[EMAIL PROTECTED]>:
> I think that tport_close could not call tport_pend callbacks because
> tport_close doesn't known what is error, only close socket, etc.
> Call tport_pend callback on tport_close it is possible only if we save
> an error code value on tport struct. In fact, on tport_close there is a
> -1 value on tport_report_error call. But hovewer, this could be a fine
> solution.
> What do you think?

If the connection is closed because of an error condition, the code
calling tport_close() should report error first (and remove the pend
callbacks from tport). If the connection is closed by application in
normal order (and if TPTAG_SDWN_ERROR(0) is not given), the pend
callbacks should be called, too, so the application waiting for
shutdown event will catch it.

--Pekka

> On Tue, 2007-11-06 at 00:04 +0200, Pekka Pessi wrote:
> > 2007/11/5, Ge@@ru <[EMAIL PROTECTED]>:
> > >  i'm using sofia 1.12.7 and i trying to use tport_pend to handled close
> > > of connection, but i have some problems:
> > >
> > > What i done on my sources:
> > >
> > > On tport object recover from incoming request a set this params:
> > > tport_set_params(tport, TPTAG_KEEPALIVE(10000),
> > >                          TPTAG_PINGPONG(20000),
> > >                          TPTAG_PONG2PING(1),
> > >                          TAG_END());
> > > and set callback:
> > > tport_pend(tport, NULL, closed_tport_callback, my_data)
> > >
> > >
> > > Exceptions not handled:
> > > 1. Manage callback on PONG timeout:
> > > In this case my callback isn't called because tport_keepalive_timer
> > > function call tport_close without call my callback.
> >
> > tport_close() should call the tport_pend() callbacks?
> >
> > Ahem, looks like nta is using TPTAG_SDWN_ERROR(0) which is not very
> > nice. I wonder why.... ;-/
> >
> > Try including TPTAG_SDWN_ERROR(1) in nta_agent_create()/nua_create() tags.
> >
>
>


-- 
Pekka.Pessi mail at nokia.com

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Sofia-sip-devel mailing list
Sofia-sip-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sofia-sip-devel

Reply via email to