RSocket(server) can't recv without using Active Object
| Fri, 2005-02-18 04:03 | |
|
hello
![]() i have some trouble in writing tcp/ip code... i want write a server on Synbian without using active object... but i have one problem... the problem is that after client(on PC) connect to Server( on Symbian) the blankSocket just can send data to Client, but the blankSocket can't recv data from Client... my pseudo code is below: RSocket iLis,iServ; RSocket iSockSvr; iSockSvr.open iLis.open iServ.open iLis.bind iLis.listen iLis.accept(iServ...) waitforrequest iServ.Send... waitforrequest <--- OK when reach this step iServ.recv waitforrequest <- not OK.... my problem is here.... ![]() Could you help me to resolve this problem... thank u very much ..... :p |
|








Forum posts: 192
it's not so hard
Forum posts: 93
I also suggest to use active objects. If you want a source code, you can take what i wrote in this topic : http://forum.newlc.com/viewtopic.php?t=5562 It's quite easy to understand !
Let me know if it was ok
MatD:-)
MatD
Forum posts: 22
but when i write server code, server can only send data to client,
it's recv is still fail.
When i write client code, client recv/send functions are successful.
i consider maybe my library has some problem...@@ ( i quess )
i run code on UIQ Emulator...
can anyone help me
Forum posts: 100
Consider using RecvOneOrMore() instead.
Forum posts: 22
this is my code..
http://home.kimo.com.tw/sjhuang38/tcp_server_h.htm
http://home.kimo.com.tw/sjhuang38/tcp_server.htm
i use red mark to show where is my problem...: (
thanks so much
ps: i use vc++ with uiq21/s60 to build the code...
and run it in Emulator..
Forum posts: 100
// iConnection.Read(writeBuffer,iStatus);
iConnection.RecvOneOrMore(writeBuffer, 0, iStatus, aLen); <-- block here...
Before going any further, it's better fix the obvious bugs first. Your "aLen" must be a member variable. It must exist until completion of receive, and in your code it will go out of scope.
RecvOneOrMore will not block. It should just acivate the read and return.
Forum posts: 100
iAddress.SetAddress(INET_ADDR(192,168,1,3));
On listening socket, NEVER use address. It will just cause endless pain and problems. Instead, just define you Bind address as
Forum posts: 100