×

Discussion Board

Results 1 to 5 of 5
  1. #1
    Registered User
    Join Date
    Oct 2005
    Posts
    16

    suckho, i have encontered the same problems. Could you tell me how you resolved it?

    Problem: Nokia 6600 Socket Server Problem
    Desciption: In Gprs, encoding using AMR515, send a packet every 200ms, every packet less than 250 bytes.
    when we send rtp packets in 100 seconds using UDP, we find there
    are 6-7 senconds interval that the socket server send noting.And the server didn't receive any
    packet, but the rtp packets did't lose. we can find this problem usually.
    Question: How to reduce the 6-7 senconds delay?

    this is the client and the sever log recoder:
    1.No.+ number: packet seqence

    2.Send Data From Queue: from the buffer send data

    3.RunL: iStatus。

    4.Cancel Write。

    5.DoCancel: call DoCancel() function

    6.every send exprired time:300ms,resend times: 0



    //client log

    No.608Send RTP Data: 17:5:28:500000
    Send Data From Queue: 17:5:28:531250
    No.609Send RTP Data: 17:5:28:671875
    No.610Send RTP Data: 17:5:28:796875
    RunL: 17:5:28:843750TimeOut = 400 No.608Send RTP Data: 17:5:28:50
    Send Data From Queue: 17:5:28:859375
    RunL: 17:5:28:890625TimeOut = 130 No.609Send RTP Data: 17:5:28:67
    Send Data >From Queue: 17:5:28:921875
    RunL: 17:5:28:937500TimeOut = 115 No.610Send RTP Data: 17:5:28:79
    No.611Send RTP Data: 17:5:29:62500
    Send Data From Queue: 17:5:29:93750
    No.612Send RTP Data: 17:5:29:171875
    No.613Send RTP Data: 17:5:29:234375
    RunL: 17:5:29:265625TimeOut = 265 No.611Send RTP Data: 17:5:29:62
    Send Data From Queue: 17:5:29:296875
    RunL: 17:5:29:328125TimeOut = 130 No.612Send RTP Data: 17:5:29:17
    Send Data >From Queue: 17:5:29:343750
    RunL: 17:5:29:390625TimeOut = 145 No.613Send RTP Data: 17:5:29:23
    No.614Send RTP Data: 17:5:29:734375
    Send Data From Queue: 17:5:29:812500
    No.615Send RTP Data: 17:5:29:968750
    No.616Send RTP Data: 17:5:30:140625
    Cancel Write
    DoCancel
    Send Data From Queue: 17:5:30:343750
    No.617Send RTP Data: 17:5:30:500000
    No.618Send RTP Data: 17:5:30:656250
    No.619Send RTP Data: 17:5:30:812500
    Cancel Write
    DoCancel
    Send Data From Queue: 17:5:30:984375
    No.620Send RTP Data: 17:5:31:156250
    No.621Send RTP Data: 17:5:31:281250
    No.622Send RTP Data: 17:5:31:437500
    Cancel Write
    DoCancel
    Send Data From Queue: 17:5:31:562500
    RunL: 17:5:31:609375TimeOut = 145 No.617Send RTP Data: 17:5:30:50
    Send Data From Queue: 17:5:31:640625
    No.623Send RTP Data: 17:5:31:765625
    No.624Send RTP Data: 17:5:31:906250
    No.625Send RTP Data: 17:5:32:15625
    Cancel Write
    DoCancel
    Send Data From Queue: 17:5:32:109375
    RunL: 17:5:32:140625TimeOut = 130 No.619Send RTP Data: 17:5:30:81
    Send Data From Queue: 17:5:32:171875
    RunL: 17:5:32:203125TimeOut = 130 No.620Send RTP Data: 17:5:31:15
    Send Data >From Queue: 17:5:32:218750
    RunL: 17:5:32:265625TimeOut = 145 No.621Send RTP Data: 17:5:31:28
    Send Data From Queue: 17:5:32:281250
    RunL: 17:5:32:328125TimeOut = 145 No.622Send RTP Data: 17:5:31:43



    //Server log

    17:05:58:392 235 No.608Send RTP Data: 17:5:28:500000

    17:05:58:529 235 No.609Send RTP Data: 17:5:28:671875

    17:05:58:690 235 No.610Send RTP Data: 17:5:28:796875

    17:05:59:090 235 No.612Send RTP Data: 17:5:29:171875

    17:05:59:269 235 No.613Send RTP Data: 17:5:29:234375

    17:05:59:471 235 No.614Send RTP Data: 17:5:29:734375

    17:05:59:657 235 No.615Send RTP Data: 17:5:29:968750

    17:05:59:830 235 No.616Send RTP Data: 17:5:30:140625

    17:06:06:141 235 No.617Send RTP Data: 17:5:30:500000

    17:06:06:320 235 No.618Send RTP Data: 17:5:30:656250

    17:06:06:522 235 No.619Send RTP Data: 17:5:30:812500

    17:06:06:719 235 No.620Send RTP Data: 17:5:31:156250

    17:06:06:903 235 No.621Send RTP Data: 17:5:31:281250


    from the above we can see from 17:05:59 to 17:06:06 the client send nothing to the sever

    how to resolve it? how to make the 6-7s interval to 2-3s interval ?
    thanks

  2. #2
    Registered User
    Join Date
    Dec 2004
    Posts
    13

    Smile Re: suckho, i have encontered the same problems. Could you tell me how you resolved it?

    Hi Dicson:
    I had discovered the same problem. I developed the application for test the data send with UDP socket on GRPS. the app does not anything exclude send udp data. the follow is my code.
    Can anyone give me some suggestion and very appreciation!

    CUdpWriter class implement the data send.
    ...some code...
    void CUdpWriter:oCancel()
    {
    LOG_CHRIS(_L8("DoCancel"));
    // 取消当前写请求
    iSocket.CancelWrite();
    //iSocket.CancelSend();

    iResendTime++;
    if (iResendTime > KMaxResend) {
    // 删除正在发送的包的数据
    HBufC8* buf = iPackets[0];
    TInetAddr* addr = iAddrs[0];
    iPackets.Remove(0);
    iAddrs.Remove(0);
    delete buf;
    delete addr;
    iResendTime = 0;
    }
    }

    void CUdpWriter::ConstructL()
    {
    CActiveScheduler::Add(this);
    iWaitTimer.CreateLocal();
    }

    void CUdpWriter::RunL()
    {
    //根据网络情况调整超时时间
    iTimeOut = PiPUtils::Tick() - iRunLTime + 100;
    // 删除正在发送的包的数据
    iResendTime = 0;
    HBufC8* buf = iPackets[0];
    TInetAddr* addr = iAddrs[0];
    iPackets.Remove(0);
    iAddrs.Remove(0);
    delete buf;
    delete addr;

    // 每次一个包发送完成就检查是否有下一个包需要发送
    if (iPackets.Count() == 0) {
    return;
    }

    // 取出缓冲里第一个包发送
    SendFromQueue();
    }

    void CUdpWriter::SendFromQueue()
    {
    iRunLTime = PiPUtils::Tick();
    HBufC8* buf = iPackets[0];
    TInetAddr* addr = iAddrs[0];
    SendDirect(*buf, *addr);
    }

    void CUdpWriter::QueueL(const TDesC8& aData, const TInetAddr& aAddr)
    {
    if (iPackets.Count() > 200) {
    return;
    }
    HBufC8* buf = HBufC8::NewLC(aData.Length());
    buf->Des().Copy(aData);
    TInetAddr* addr = new (ELeave) TInetAddr();
    PUSH(addr);
    *addr = aAddr;
    iPackets.Append(buf);
    iAddrs.Append(addr);
    POP(addr);
    POP(buf);
    }

    void CUdpWriter::SendDirect(const TDesC8& aData, TInetAddr& aAddr)
    {
    iLastSendTime = PiPUtils::Tick();
    iSocket.SendTo(aData, aAddr, 0, iStatus);
    SetActive();
    }

    void CUdpWriter::IssueWriteL(const TDesC8& aData, const TInetAddr& aAddr)
    {
    // 如果当前正在进行请求,则把新的数据存放到缓冲区中,否则直接发送
    TBool sendNow = ETrue;
    TUint now = PiPUtils::Tick();
    if (IsActive()) {
    if (iLastSendTime + KTimeOut < now) {
    // 如果已经超时,则取消上一个请求
    sendNow = ETrue;
    } else {
    sendNow = EFalse;
    }
    }
    QueueL(aData, aAddr);
    if (sendNow) {
    SendFromQueue();
    }
    }

    void CUdpWriter::IssueWriteL(const TText8* aData, TInt aLength, const TInetAddr& aAddr)
    {
    IssueWriteL(TPtrC8(aData, aLength), aAddr);
    }

    // 停止写操作,所有没有写完的数据都放弃
    void CUdpWriter::Stop()
    {
    Cancel();
    iPackets.ResetAndDestroy();
    iAddrs.ResetAndDestroy();
    }
    ...some code ...

  3. #3
    Registered User
    Join Date
    Nov 2004
    Posts
    42

    Re: suckho, i have encontered the same problems. Could you tell me how you resolved i

    Hi, me too with a similar problem.
    I'm capturing audio in a 6630 by using CmdaAudioInputstream and then I send the AMR converted frames directly to a udp socket (over WCDMA).
    They are very small and frequent (13byte long with a rate of about 50 per sec).
    I send a packet only if the previous sendTo is over ( !IsActive() ) otherwise I drop it.
    It works almost perfectly and I can decode the sent packets in my PC.
    I log the sending process and I can see they almost never find the socket occupied. For several seconds its absolutely perfect but now and then (every few seconds)a SendTo takes longer, about 240msecs and I get 12-14 consecutive packets dropped in that case.
    I've tried to increase the thread priority to AbsoluteHigh but it doesn't improve.
    I don't have any 3rd party app in background (formatted phone) and the signal strength is high...
    Rocco

  4. #4
    Registered User
    Join Date
    Dec 2004
    Posts
    13

    Re: suckho, i have encontered the same problems. Could you tell me how you resolved it?

    Rocco:
    over GPRS, i test this case on nokia 6600, 6680, smartphone in one place, i find this problem, and test in another place, this case does not occur.
    i not test on 6630, maybe you can test on other terminal or in other place.
    i think the wireless network will effect this.

  5. #5
    Registered User
    Join Date
    Nov 2004
    Posts
    42

    Red face Re: suckho, i have encontered the same problems. Could you tell me how you resolved i

    Update: I still meet the problem of the blocked SendTo() but I found that in my case it appears to be only transitory at the beginning of the streaming process.
    It affects only the firs 20 secs of the transmission. During this period, for four times I get the socket blocked for 240ms. After that it's all ok.
    Now I've tested over periods longer than a minute.
    My previous tests were always too short so I didn't observed that difference...

    So I think my problem was different from yours...sorry

    Rocco

Similar Threads

  1. Usability problems still need fixing. Can we help nokia?
    By Trial in forum General Development Questions
    Replies: 3
    Last Post: 2004-02-26, 15:05
  2. problems with app on Nokia 6600
    By Java-Developer in forum Mobile Java General
    Replies: 6
    Last Post: 2004-02-16, 13:49
  3. Problems with Nokia carkit CK-1W
    By Batunas in forum General Development Questions
    Replies: 1
    Last Post: 2004-02-09, 18:18
  4. Problems installing Nokia developers suite with JBuilder 8 Personal
    By maaberge in forum Mobile Java Tools & SDKs
    Replies: 0
    Last Post: 2003-04-05, 00:42
  5. general problems in 3410
    By fredgauchet in forum Mobile Java General
    Replies: 1
    Last Post: 2002-08-26, 14:38

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •