I've got a modified version of the sockets example working, but I want to generate, or at least I expected to have some sort of error, when I tried to connect to a server that is not running.. I used the code
but no error was generated.. Urgent help is required... :-)
Here's the meat of the connection code, the message boxes is used for debugging on the device.. 6630. Essentially, I'm trying to connect over the internet using the vodafone internet IAP to a my local echo sever. I can connect Ok, but I still "seam" to be able t o connect even when my echo server is shut down? Thanks
// Start the Connection
void CExEngine::ConnectL(TUint32 aAddr)
// 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, iRConn));
// Set up address information
if (iStatus == KErrNone)
// Connection completed successfully
// Get the time
I can't see how the port number and IP address affects not getting an error code if the server is not running. Have you had this happen to you before. From my knowledge of sockets, even if I tried to write to it, I should get an i/o exception, I don't even get this, Please educate :-)
Has anyone tried using the symbian Tcp connection to blocked port. i.e iSocket.connect(iStatus); Make the connection to a real IP address but to a blocked port . Do you get an error ? I don't seam to one. Help :-)
Has anyone tried using the symbian Tcp connection to blocked port. i.e iSocket.connect(iStatus); and using Rconnection. Make the connection to a real IP address but to a blocked port . Do you get an error ? I don't seem to one. Help :-)
Socket Connect returns KErrNone even if server is not running
I am also facing the same problem. I have defined two servers- primary and secondary. In case my app fails to connect to primary server, it can connect to secondary. But the problem is that anytime I call iSocket.Connect(), it rtuens immediately (I mean RunL is called immediately) with iStataus as KErrNone. It always return me KErrNone even if my server is not running. The strange thing is that it even doesn't time out. So my app just keep waiting for connect to finish.
As per documentation the Connect should return with some error in RunL, but in reality it doesn't. Did you find some soultion for your problem.
The symbian rsocket.connect() API does not appear to inform yu about a succesful connection, instead, i believe it informs yu that an atempt at a connection has sucesfully started. I used a work around to solve my problem. The application I was working on was designed to handle enquire response data between the client and the server. So after I get the Kerrnon, I send an enqire data packet and if don't get a response within say 10 secs, I assume the connection is down.