I would like to ask a question about correct way of canceling socket operations on Symbian. Basically, we have two options, as far as I understand:
- Call CActive::Cancel() on a ActiveObject that is used for asynchronous requests.
- Call RSocket::CancelRead() or RSocket::CancelSend() or RSocket::CancelAll()
Which way is correct? Or maybe I should call both methods – from CActive and from RSocket?
Thanks in advance.
I haven’t wrote anything using RSocket class, but from it’s API I guess it’s used like this: you have an AO and you pass it’s iStatus to one of the RSocket asynchronous methods (Send(), Read(), Recv(), etc.). In that case you should call cancel on RSocket (CancelSend() if you passed iStatus to Send(), CancelRead() if you used Read(), etc. or just CancelAll()), and it will complete your AO with KErrCancel.