Symbian: clear buffer of RSocket object
- by Heinz
Hi,
I have to come back once again to sockets in Symbian. Code to set up a connection to a remote server looks as follows:
TInetAddr serverAddr;
TUint iPort=111;
TRequestStatus iStatus;
TSockXfrLength len;
TInt res = iSocketSrv.Connect();
res = iSocket.Open(iSocketSrv,KAfInet,KSockStream, KProtocolInetTcp);
res = iSocket.SetOpt(KSoTcpSendWinSize, KSolInetTcp, 0x10000);
serverAddr.SetPort(iPort);
serverAddr.SetAddress(INET_ADDR(11,11,179,154));
iSocket.Connect(serverAddr,iStatus);
User::WaitForRequest(iStatus);
Over the iSocket i receive packets of variable size. On very few occurences it happens that such a packet is corrupted. What I would like to do then is to clear all the data that is currently in the iSocket buffer and ready to be read. I have not seen any method of RSocket that allows me to clear the content of the buffer. Does anyone know how to do that? If possible, I would like to avoid using RecvOneOrMore() or similar recv function clear the buffer
Thanks