i'm new to symbian and i'm certainly trying to play with the methods in the RSockets classes for my TCP listener ...
i'll tell u what exactly i am doing..all my method calls are from the RSockets class are in the foll sequence..
1. Open() method to create a blank socket
2. Bind() method used to bind to port (7030 in my case).
3. Listen() method to specify no. of client allowed to connect.
4. Accept() method to marry the incoming socket to the blank socket which'll be passed as a parameter to the Accept() method.
It works perfectly fine uptil after the Accept() call...and then it gives me a App.Closed panic error 17. I also checked out the error codes and error 17 says - No Sockets currently open.
I dunno if my Accept call is right...coz the Accept(RSocket& aBlankSocket) takes an RSocket (addressOf)object as a parameter and the docs clearly says..it shud be an blank socket..so i make use of the Open(RSocketServ& aServer) using an RSocket obj and pass it as a parameter to the Accept() call...I wonder if this is correct...???
dunno where i am doing wat wrong...??
Am also adding my listener method...
Quote : *********************************
void CSocketsEngine::Listen() // <a name="ConnectL32">
//Initiate attempt to connect to a socket by IP address
if (iEngineStatus == ENotConnected)
//Open a TCP socket
User::LeaveIfError(iSocket.Open(iSocketServ, KAfInet, KSockStream, KProtocolInetTcp));
//Binding to port 7030
TUint portNum = 7030;
TInt bindStat = iSocket.Bind(tsaPort);
RSocket::Listen and RSocket::Bind are synchronous services. You don't have to use req. status when calling these methods. Note that you should pass a TInetAddr instead of a TSockAddr, because TSockAddr is for further derivation and TInetAddr is one of its successors.
On the other hand, RSocket::Accept and RSocket::Read are asynchronous operations. What is missing then from your code? Well, I have not seen that you wait for the completion of your Accept call. That is the source of your problem : it is not enough to call Accept synchronously. Having Accept operation completed, you may issue the other asynchronous request, Read.