class MSocketNotify |
Abstract base class used by a CServProviderBase-derived object, through its iSocket member, to notify the socket server that various events have occurred.
The class provides several up-call member functions.
All up-calls on an MSocketNotify should be made in the context of the socket server's thread - i.e. the thread which called NewSAPL() on the protocol.
Since v5.0
Public Member Functions | |
---|---|
void | Bearer(const TDesC8 &) |
void | CanClose(TDelete) |
void | CanClose(const TDesC8 &, TDelete) |
void | CanSend() |
void | ConnectComplete() |
void | ConnectComplete(const TDesC8 &) |
void | ConnectComplete(CServProviderBase &) |
void | ConnectComplete(CServProviderBase &, const TDesC8 &) |
void | Disconnect(void) |
void | Disconnect(TDesC8 &) |
void | Error(TInt, TUint) |
void | IoctlComplete(TDesC8 *) |
void | JoinedSubConnection() |
void | LeftSubConnection() |
void | NewData(TUint) |
void | NoBearer(const TDesC8 &) |
void | SubConnectionJoinFailed(TInt) |
Public Member Enumerations | |
---|---|
enum | TDelete { EDelete, EDetach } |
enum | TOperationBitmasks { EErrorSend = 0x0000001, EErrorRecv = 0x0000002, EErrorConnect = 0x0000004, EErrorClose = 0x00000008, EErrorIoctl = 0x00000010, EErrorFatal = 0x10000000, EErrorAllOperations = 0x7fffffff } |
void | Bearer | ( | const TDesC8 & | aConnectionInfo | ) | [pure virtual] |
Indicates the bearer available.
const TDesC8 & aConnectionInfo |
void | CanClose | ( | TDelete | aDelete = EDelete | ) | [pure virtual] |
Indicates that the SAP has finished closing down.
This up-call is the response to a Shutdown(). A connection-oriented protocol should call CanClose() when it has terminated communications with the remote host. Protocols can call CanClose() from within their Shutdown() code. After CanClose() has been called, an SAP may be deleted by the socket server.
The protocol must not access the CServProviderBase object after calling CanClose().
TDelete aDelete = EDelete | Delete SAP. |
void | CanClose | ( | const TDesC8 & | aDisconnectData, |
TDelete | aDelete = EDelete | |||
) | [pure virtual] |
Indicates that the SAP has finished closing down.
This up-call is the response to a Shutdown(). A connection-oriented protocol should call CanClose() when it has terminated communications with the remote host. Protocols can call CanClose() from within their Shutdown() code. After CanClose() has been called, an SAP may be deleted by the socket server.
The protocol must not access the CServProviderBase object after calling CanClose().
void | ConnectComplete | ( | ) | [pure virtual] |
Indicates that a connection attempt has completed successfully (for active opens).
There are four versions of this up-call: two are for active opens and two are for passive opens. Both active and passive versions support a variant carrying user connection data for protocols which support it.
A connection-less protocol should never call the ConnectComplete() up-calls.
A protocol should keep a count of sockets which have called ConnectComplete() but have not had Start() called. Sockets in this state have their Error() and NewData() calls deferred until Start() is called.
void | ConnectComplete | ( | const TDesC8 & | aConnectData | ) | [pure virtual] |
Indicates that a connection attempt has completed successfully (for active opens).
There are four versions of this up-call: two are for active opens and two are for passive opens. Both active and passive versions support a variant carrying user connection data for protocols which support it.
A connection-less protocol should never call the ConnectComplete() up-calls.
A protocol should keep a count of sockets which have called ConnectComplete() but have not had Start() called. Sockets in this state have their Error() and NewData() calls deferred until Start() is called.
const TDesC8 & aConnectData | Connect data (if supported). |
void | ConnectComplete | ( | CServProviderBase & | aSSP | ) | [pure virtual] |
Indicates that a connection attempt has completed successfully (for passive opens).
There are four versions of this up-call: two are for active opens and two are for passive opens. Both active and passive versions support a variant carrying user connection data for protocols which support it.
The versions of ConnectComplete() for passive opens carry a new SSP (socket service provider, or SAP) for the newly created socket. A new socket will then be linked up to the SSP and data transfer can take place. The original socket stays listening.
A connection-less protocol should never call the ConnectComplete() up-calls.
A protocol should keep a count of sockets which have called ConnectComplete() but have not had Start() called. Sockets in this state have their Error() and NewData() calls deferred until Start() is called.
CServProviderBase & aSSP | The new SSP for passive opens. |
void | ConnectComplete | ( | CServProviderBase & | aSSP, |
const TDesC8 & | aConnectData | |||
) | [pure virtual] |
Indicates that a connection attempt has completed successfully (for passive opens).
There are four versions of this up-call: two are for active opens and two are for passive opens. Both active and passive versions support a variant carrying user connection data for protocols which support it.
The versions of ConnectComplete() for passive opens carry a new SSP (socket service provider, or SAP) for the newly created socket. A new socket will then be linked up to the SSP and data transfer can take place. The original socket stays listening.
A connection-less protocol should never call the ConnectComplete() up-calls.
A protocol should keep a count of sockets which have called ConnectComplete() but have not had Start() called. Sockets in this state have their Error() and NewData() calls deferred until Start() is called.
CServProviderBase & aSSP | The new SSP for passive opens. |
const TDesC8 & aConnectData | Connect data (if supported). |
void | Disconnect | ( | void | ) | [pure virtual] |
Indicates that the other end of a connection has disconnected.
This is analogous to CanClose(), but in this case the other end initiated it.
Once the client has called Shutdown() it is illegal to call Disconnect(). Instead, CanClose() or Error(KErrDisconnected) should be called.
void |
void | Disconnect | ( | TDesC8 & | aDisconnectData | ) | [pure virtual] |
Indicates that the other end of a connection has disconnected.
This is analogous to CanClose(), but in this case the other end initiated it.
Once the client has called Shutdown() it is illegal to call Disconnect(). Instead, CanClose() or Error(KErrDisconnected) should be called.
TDesC8 & aDisconnectData |
void | Error | ( | TInt | anError, |
TUint | anOperationMask = EErrorAllOperations | |||
) | [pure virtual] |
Tells the socket server that an error state has arisen within the protocol.
It should not be used to report programmatic errors, either in the protocol itself or the socket server (a panic should be used in these cases). When Error() is called on a connection-oriented socket, the socket is moved into a dead state which denies user access to it.
void | IoctlComplete | ( | TDesC8 * | aBuf | ) | [pure virtual] |
Indicates that the currently pending Ioctl has completed.
The parameter aBuf is protocol defined - in fact it is defined by the specific Ioctl.
TDesC8 * aBuf | Any data requested by the Ioctl operation. |
void | JoinedSubConnection | ( | ) | [inline, virtual] |
Indicates that this socket is now completed an asynchronous join with a sub-connection. It now can use the properties of the sub-connection
void | LeftSubConnection | ( | ) | [inline, virtual] |
Indicates that this socket has now completed an asynchronous leave from a sub-connection. The socket is now connected to the sub-connection anymore.
void | NewData | ( | TUint | aCount | ) | [pure virtual] |
Indicates that new data is available on a service access point
For a stream-oriented protocol aCount should be a byte count; for datagram-oriented sockets aCount should be a datagram count.
aCount is the amount of new data, not the total amount of data waiting to be read.
TUint aCount | The amount of new data. A value of KNewDataEndofData indicates that the socket is in a half-closed state and will receive no more data. Any subsequent reads will complete with KErrEof and a length of 0. |
void | NoBearer | ( | const TDesC8 & | aConnectionParams | ) | [pure virtual] |
Indicates that there are no bearer available
const TDesC8 & aConnectionParams |
void | SubConnectionJoinFailed | ( | TInt | ) | [inline, virtual] |
Indicates that this socket was not able to complete an asynchronous join with a sub-connection. The socket is still joined, but cannot use the properties of the sub-connection
TInt |
Error codes.
EErrorSend = 0x0000001 |
An error has occurred which affects Send() operations |
EErrorRecv = 0x0000002 |
An error has occurred which affects Receive() operations. |
EErrorConnect = 0x0000004 |
An error has occurred which affects Connect() operations |
EErrorClose = 0x00000008 |
An error has occurred which affects Close() operations |
EErrorIoctl = 0x00000010 |
An error has occurred which affects Ioctl() operations |
EErrorFatal = 0x10000000 |
A fatal error has occurred |
EErrorAllOperations = 0x7fffffff |
An error has occurred which affects all operations |
Copyright ©2010 Nokia Corporation and/or its subsidiary(-ies).
All rights
reserved. Unless otherwise stated, these materials are provided under the terms of the Eclipse Public License
v1.0.