Hello,

I have a function just to open the connection to Internet.

RSocketServ iServer,
User::LeaveIfError(iServer.Connect());
RSocket socket;
TInt result=socket.Open(iServer,KAfInet,KSockStream,KUndefinedProtocol);
User::LeaveIfError(result);
//try to connect to www.nokia.com to get connection
TInetAddr serverAddr(INET_ADDR(147,243,3,73),80);
socket.Connect(serverAddr,iStatus);
User::WaitForRequest(iStatus);
socket.CancelAll();
socket.Close();
iServer.Close();

The first time I call this function, everything is right. But if I can it again, the socket can't connect. And if I try to connect to another server using the port 80,it also fails. But if I try to use another port, it success.

Does anybody know why?From S60's SDK,RSocket.Close:Closes a socket. If a socket has been opened using Open() then it should be closed using Close(). This will ensure all associated resources are released.

If someone knows,can you tell me why? Thank you very much.