Changeset 806 for pjproject/branches/symbian/pjlib/src/pjlib-test/sock.c
- Timestamp:
- Nov 19, 2006 2:59:13 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/branches/symbian/pjlib/src/pjlib-test/sock.c
r788 r806 67 67 #define UDP_PORT 51234 68 68 #define TCP_PORT (UDP_PORT+10) 69 #define BIG_DATA_LEN 900069 #define BIG_DATA_LEN 8192 70 70 #define ADDRESS "127.0.0.1" 71 71 … … 350 350 rc = -121; goto on_error; 351 351 } 352 352 353 353 /* Test send/recv, with sendto */ 354 354 rc = send_recv_test(PJ_SOCK_DGRAM, ss, cs, &dstaddr, NULL, … … 362 362 if (rc != 0) 363 363 goto on_error; 364 364 365 // This test will fail on S60 3rd Edition MR2 366 #if 1 365 367 /* connect() the sockets. */ 366 368 rc = pj_sock_connect(cs, &dstaddr, sizeof(dstaddr)); … … 380 382 if (rc != 0) 381 383 goto on_error; 384 #endif 382 385 383 386 on_error: … … 437 440 } 438 441 442 #if 0 443 #include "../pj/os_symbian.h" 444 static 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 439 493 int sock_test() 440 494 { … … 443 497 pj_create_random_string(bigdata, BIG_DATA_LEN); 444 498 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 445 506 rc = format_test(); 446 507 if (rc != 0)
Note: See TracChangeset
for help on using the changeset viewer.