Discussion Board
Server on emulator doesnt recv via sockets
2004-10-27, 08:05
#1
Registered User
Hi,
I am not able to recieve data over sockets, when the server is running on the emulator( I have done the settings necessary for using sockets (wsp enable))
================== SERVER CODE ================
RSocketServ iserver;
RSocket listening,blank;
TRequestStatus istat;
iserver.Connect(5);
result=listening.Open(iserver,KAfInet,KSockStream,KProtocolInetTcp);
result=blank.Open(iserver);
TInetAddr serv_add(KInetAddrLoop,8000);
result=listening.Bind(serv_add);
listening.Listen(5);
listening.Accept(blank,istat);
User::WaitForRequest(istat);
MyStruct head2;
TPckgBuf<MyStruct> servwritebuf(head2);
blank.Recv(servwritebuf,0,istat);
===> User::WaitForRequest(istat);========> BLOCKS HERE
=============== CLIENT CODE ===================
RSocketServ cliserv;
RSocket clisock;
TRequestStatus clistat;
cliserv.Connect(8);
clisock.Open(cliserv,KAfInet,KSockStream,KProtocolInetTcp);
TInetAddr cliadd(KInetAddrLoop,8000);
clisock.Connect(cliadd,clistat);
User::WaitForRequest(clistat);
MyStruct head2;
head2.Flag=2;
head2.length=3;
TPckgBuf<MyStruct> servwritebuf(head2);
clisock.Send(servwritebuf,0,clistat);
User::WaitForRequest(clistat); ==> CLIENT SENDS WITHOUT ERR
return(1);
==========================================
Not able to figure out the problem.
Please help!
Posting Permissions
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
Forum Rules