Ignore:
Timestamp:
Nov 19, 2006 2:59:13 PM (17 years ago)
Author:
bennylp
Message:

Fixes for S60 3rd edition:

  • it seems there is a problem with sending UDP packet inside connected UDP socket. This (still) causes pjlib-test to fail. No workaround yet.
  • fixed bug in Symbian's ioqueue when data is immediately available.
  • UDP connect()/getsockname() doesn't return the correct interface IP address, causing pj_gethostip() to fail, and subsequently SIP transport's name determination to fail. Because of this, for now SIP transport's name must be initialized properly (see sipstateless.c)
File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/branches/symbian/pjlib/src/pjlib-test/sock.c

    r788 r806  
    6767#define UDP_PORT        51234 
    6868#define TCP_PORT        (UDP_PORT+10) 
    69 #define BIG_DATA_LEN    9000 
     69#define BIG_DATA_LEN    8192 
    7070#define ADDRESS         "127.0.0.1" 
    7171 
     
    350350        rc = -121; goto on_error; 
    351351    } 
    352              
     352 
    353353    /* Test send/recv, with sendto */ 
    354354    rc = send_recv_test(PJ_SOCK_DGRAM, ss, cs, &dstaddr, NULL,  
     
    362362    if (rc != 0) 
    363363        goto on_error; 
    364  
     364     
     365// This test will fail on S60 3rd Edition MR2 
     366#if 1 
    365367    /* connect() the sockets. */ 
    366368    rc = pj_sock_connect(cs, &dstaddr, sizeof(dstaddr)); 
     
    380382    if (rc != 0) 
    381383        goto on_error; 
     384#endif 
    382385 
    383386on_error: 
     
    437440} 
    438441 
     442#if 0 
     443#include "../pj/os_symbian.h" 
     444static int connect_test() 
     445{ 
     446        RSocketServ rSockServ; 
     447        RSocket rSock; 
     448        TInetAddr inetAddr; 
     449        TRequestStatus reqStatus; 
     450        char buffer[16]; 
     451        TPtrC8 data((const TUint8*)buffer, (TInt)sizeof(buffer)); 
     452        int rc; 
     453         
     454        rc = rSockServ.Connect(); 
     455        if (rc != KErrNone) 
     456                return rc; 
     457         
     458        rc = rSock.Open(rSockServ, KAfInet, KSockDatagram, KProtocolInetUdp); 
     459        if (rc != KErrNone)  
     460        {                
     461                rSockServ.Close(); 
     462                return rc; 
     463        } 
     464         
     465        inetAddr.Init(KAfInet); 
     466        inetAddr.Input(_L("127.0.0.1")); 
     467        inetAddr.SetPort(80); 
     468         
     469        rSock.Connect(inetAddr, reqStatus); 
     470        User::WaitForRequest(reqStatus); 
     471 
     472        if (reqStatus != KErrNone) { 
     473                rSock.Close(); 
     474                rSockServ.Close(); 
     475                return rc; 
     476        } 
     477     
     478        rSock.Send(data, 0, reqStatus); 
     479        User::WaitForRequest(reqStatus); 
     480         
     481        if (reqStatus!=KErrNone) { 
     482                rSock.Close(); 
     483                rSockServ.Close(); 
     484                return rc; 
     485        } 
     486         
     487        rSock.Close(); 
     488        rSockServ.Close(); 
     489        return KErrNone; 
     490} 
     491#endif 
     492 
    439493int sock_test() 
    440494{ 
     
    443497    pj_create_random_string(bigdata, BIG_DATA_LEN); 
    444498 
     499// Enable this to demonstrate the error witn S60 3rd Edition MR2 
     500#if 0 
     501    rc = connect_test(); 
     502    if (rc != 0) 
     503        return rc; 
     504#endif 
     505     
    445506    rc = format_test(); 
    446507    if (rc != 0) 
Note: See TracChangeset for help on using the changeset viewer.