symbian: synchronously events with RunL - maybe solution to the stuck problem in symbian

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



ok, i see what u mean.

the call to the new "WaitForEvent" should be the last code in the
pj_sock_send() and no other code exept for error handeling should be there
like i see for example:


/*
 * Send data
 */
PJ_DEF(pj_status_t) pj_sock_send(pj_sock_t sock,
                 const void *buf,
                 pj_ssize_t *len,
                 unsigned flags)
{
    PJ_CHECK_STACK();
    PJ_ASSERT_RETURN(sock && buf && len, PJ_EINVAL);

    // Return failure if access point is marked as down by app.
    PJ_SYMBIAN_CHECK_CONNECTION();

    CPjSocket *pjSock = (CPjSocket*)sock;
    RSocket &rSock = pjSock->Socket();

    // send() should only be called to connected socket
    PJ_ASSERT_RETURN(pjSock->IsConnected(), PJ_EINVALIDOP);

    TPtrC8 data((const TUint8*)buf, (TInt)*len);
    TRequestStatus reqStatus;
    TSockXfrLength sentLen;

    rSock.Send(data, flags, reqStatus, sentLen);
    User::WaitForRequest(reqStatus);

    if (reqStatus.Int()==KErrNone) {
    //*len = (TInt) sentLen.Length();
    return PJ_SUCCESS;
    } else
    return PJ_RETURN_OS_ERROR(reqStatus.Int());
}


On Thu, Dec 10, 2009 at 9:14 AM, Benny Prijono <bennylp at teluu.com> wrote:

> On Thu, Dec 10, 2009 at 6:47 AM, nir elkayam <nir.elkayam at gmail.com>
> wrote:
> > hi benny,
> >
> > I see what u say but this issue will also raise with using regular async
> > events.
>
> The difference is, normally we would expect events to happen inside
> the "poll" function, and we can be sure that things are in good state
> before the events are executed.
>
> With the CActiveScheduler::Start() approach, now events can happen
> pretty much anywhere where this approach is used. Like I said, for
> example a timer event may elapse while we're inside pj_sock_send(),
> and this is bad.
>
> > is there anyway where u implement the PENDING state on send/sendto (i
> mean
> > other os.)
> >
>
> Async I/O is always done with ioqueue.
>
> Cheers
>  Benny
>
> _______________________________________________
> Visit our blog: http://blog.pjsip.org
>
> pjsip mailing list
> pjsip at lists.pjsip.org
> http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org
>



-- 
??? ??????
??: 050-3930056
nir.elkayam at gmail.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.pjsip.org/pipermail/pjsip_lists.pjsip.org/attachments/20091210/7c5afd3b/attachment.html>


[Index of Archives]     [Asterisk Users]     [Asterisk App Development]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [Linux API]
  Powered by Linux