ESock::MSessionControlNotify Class Reference

class ESock::MSessionControlNotify

Abstract base class used by a CSubConnectionFlowBase to support session binders, 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 v9.3

Public Member Functions
voidCanClose(MSessionControlNotify::TDelete)
voidCanClose(const TDesC8 &, MSessionControlNotify::TDelete)
voidConnectComplete()
voidConnectComplete(const TDesC8 &)
voidConnectComplete(CSubConnectionFlowBase &)
voidConnectComplete(CSubConnectionFlowBase &, const TDesC8 &)
voidDisconnect(void)
voidDisconnect(TDesC8 &)
voidDisconnectFromListener(CSubConnectionFlowBase &)
TInt Error(TInt, TUint)
voidIoctlComplete(TDesC8 *)
voidSetLocalNameComplete()
Public Member Enumerations
enumTDelete { EDelete, EDetach }
enumTOperationBitmasks {
EErrorSend = 0x0000001, EErrorRecv = 0x0000002, EErrorConnect = 0x0000004, EErrorClose = 0x00000008, EErrorIoctl = 0x00000010, EErrorCompleteConnect = 0x00000020, EErrorCompleteSetLocalName = 0x00000040, EErrorFatal = 0x10000000, EErrorAllOperations = 0x7fffffff, EErrorLegacySupportRequest = 0x40000000
}

Member Functions Documentation

CanClose(MSessionControlNotify::TDelete)

voidCanClose(MSessionControlNotify::TDeleteaDelete = MSessionControlNotify::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.

Note:

The protocol must not access the CSubConnectionFlowBase object after calling CanClose().

Parameters

MSessionControlNotify::TDelete aDelete = MSessionControlNotify::EDeleteDelete SAP.

CanClose(const TDesC8 &, MSessionControlNotify::TDelete)

voidCanClose(const TDesC8 &aDisconnectData,
MSessionControlNotify::TDeleteaDelete = MSessionControlNotify::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.

Note:

The protocol must not access the CSubConnectionFlowBase object after calling CanClose().

Parameters

const TDesC8 & aDisconnectDataAny user data carried on the disconnect frame.
MSessionControlNotify::TDelete aDelete = MSessionControlNotify::EDeleteDelete SAP.

ConnectComplete()

voidConnectComplete()[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.

Note:

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.

ConnectComplete(const TDesC8 &)

voidConnectComplete(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.

Note:

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.

Parameters

const TDesC8 & aConnectDataConnect data (if supported).

ConnectComplete(CSubConnectionFlowBase &)

voidConnectComplete(CSubConnectionFlowBase &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.

Note:

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.

Parameters

CSubConnectionFlowBase & aSSPThe new SSP for passive opens.

ConnectComplete(CSubConnectionFlowBase &, const TDesC8 &)

voidConnectComplete(CSubConnectionFlowBase &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.

Note:

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.

Parameters

CSubConnectionFlowBase & aSSPThe new SSP for passive opens.
const TDesC8 & aConnectDataConnect data (if supported).

Disconnect(void)

voidDisconnect(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.

Parameters

void

Disconnect(TDesC8 &)

voidDisconnect(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.

Parameters

TDesC8 & aDisconnectData

DisconnectFromListener(CSubConnectionFlowBase &)

voidDisconnectFromListener(CSubConnectionFlowBase &aSSP)[pure virtual]

Indicates that the other end of a passively opened connection which has not been accepted yet and is waiting in the accept queue has been disconnected.

This is analogous to Disconnect(), but is directed towards the listening socket so that it can remove the SAP from the accept queue.

It is illegal to call DisconnectFromListener twice.

Parameters

CSubConnectionFlowBase & aSSP

Error(TInt, TUint)

TInt Error(TIntanError,
TUintanOperationMask = MSessionControlNotify::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.

Parameters

TInt anErrorKErrNone or another of the system-wide error codes.
TUint anOperationMask = MSessionControlNotify::EErrorAllOperationsA bitmask of TOperationBitmasks values specifying which

IoctlComplete(TDesC8 *)

voidIoctlComplete(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.

Parameters

TDesC8 * aBufAny data requested by the Ioctl operation.

SetLocalNameComplete()

voidSetLocalNameComplete()[pure virtual]

Indicates that the set local name sequence is complete.

Member Enumerations Documentation

Enum TDelete

Enumerators

EDelete

Delete SAP

EDetach

Don't delete SAP

Enum TOperationBitmasks

Enumerators

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

EErrorCompleteConnect = 0x00000020

An error has occurred which only requires to CompleteConnect beeing called

EErrorCompleteSetLocalName = 0x00000040

An error has occurred which affects SetLocalName() operations

EErrorFatal = 0x10000000

A fatal error has occurred

EErrorAllOperations = 0x7fffffff

An error has occurred which affects all operations

EErrorLegacySupportRequest = 0x40000000

A pseudo-error: the SAP is requesting a legacy compatibility feature as specified by the error code. This flag cannot be combined with any others