class CProtocolBase : public CBase |
Protocols created by protocol families must be instances of sub-classes of the abstract CProtocolBase . Since v5.0
Protected Member Functions | |
---|---|
IMPORT_C void | CanClose () |
Private Member Functions | |
---|---|
void | TryDelete () |
Private Attributes | |
---|---|
CProtocolRef * | iManagerRef |
TInt | iRefCount |
IMPORT_C void | BindL | ( | CProtocolBase * | protocol, |
TUint | id | |||
) | [virtual] |
This function panics with a panic number of EDoesNotBindBelow.
CProtocolBase * protocol | The higher level protocol requesting to bind |
TUint id | The ID number of the protocol requesting to bind |
IMPORT_C void | BindToL | ( | CProtocolBase * | protocol | ) | [virtual] |
This function panics with a panic number of EDoesNotBindAbove.
CProtocolBase * protocol | The lower level protocol whose bind function must be called. |
IMPORT_C void | CanClose | ( | ) | [protected] |
Called by derived classes when an acceptable closedown condition has been reached.
Derived classes should not override this function.
CloseNow() for more details.
IMPORT_C void | Close | ( | ) | [virtual] |
Closes a client connection.
The default implementation decrements the reference count and calls CloseNow() if no clients are connected.
Any implementations by derived classes should call this base class implementation.
IMPORT_C void | CloseNow | ( | ) | [virtual] |
Closes the protocol.
Called by Close() when all clients referencing a protocol have disconnected.
The default implementation simply deletes the object. Derived classes can implement this function to provide a delayed closedown: for example, to allow reliable protocols to ensure that all data has drained from the stack before it is deleted. When an acceptable closedown condition has been reached, the protocol should call CanClose() .
IMPORT_C void | Error | ( | TInt | anError, |
CProtocolBase * | aSourceProtocol = NULL | |||
) | [virtual] |
This function panics with a panic number of EErrorCallNotHandled unless the error is KErrCancel which is simply ignored.
TInt anError | The error code |
CProtocolBase * aSourceProtocol = NULL | The protocol raising the error |
IMPORT_C TInt | GetOption | ( | TUint | level, |
TUint | name, | |||
TDes8 & | option, | |||
CProtocolBase * | aSourceProtocol = NULL | |||
) | [virtual] |
Gets options for the protocol on behalf of socket server clients.
The option parameter is protocol-defined - this is a generic API. The protocol is passed in because you might get GetOption() calls from multiple bindees - this is actually more meaningful for SetOption() .
TUint level | |
TUint name | |
TDes8 & option | |
CProtocolBase * aSourceProtocol = NULL | The protocol making the request. |
void | Identify | ( | TServerProtocolDesc * | aProtocolDesc | ) | const [pure virtual] |
Fills in the passed TServerProtocolDesc with data describing the protocol.
TServerProtocolDesc * aProtocolDesc | Protocol description object to fill in |
IMPORT_C void | InitL | ( | TDesC & | aTag | ) | [virtual] |
Initialises a protocol before any binding is performed. A protocol can override it to create any further resources it may require - this might include allocating buffers, opening devices or reading more configuration information.
If the protocol encounters any errors it should leave.
This implementation does nothing.
TDesC & aTag | The string identifier for the protocol as given by its section header in esock.ini |
IMPORT_C CHostResolvProvdBase * | NewHostResolverL | ( | ) | [virtual] |
This function panics with a panic number of EBadHostResolver.
IMPORT_C CNetDBProvdBase * | NewNetDatabaseL | ( | ) | [virtual] |
This function panics with a panic number of EBadNetDBRequest.
IMPORT_C CServProviderBase * | NewSAPL | ( | TUint | aProtocol | ) | [virtual] |
Creates a new service access point.
If the protocol cannot create the CServProviderBase for any reason, it should leave.
TUint aProtocol | Protocol. |
IMPORT_C CServiceResolvProvdBase * | NewServiceResolverL | ( | ) | [virtual] |
This function panics with a panic number of EBadServiceResolver.
IMPORT_C void | Open | ( | ) | [virtual] |
Opens a client connection.
The default implementation simply increments the reference count.
Any implementations by derived classes should call this base class implementation.
IMPORT_C void | Process | ( | RMBufChain & | , |
CProtocolBase * | aSourceProtocol = NULL | |||
) | [virtual] |
This function panics with a panic number of ECantProcessMbufs.
RMBufChain & | |
CProtocolBase * aSourceProtocol = NULL |
IMPORT_C void | Process | ( | TDes8 & | aPDU, |
TSockAddr * | from, | |||
TSockAddr * | to = NULL, | |||
CProtocolBase * | aSourceProtocol = NULL | |||
) | [virtual] |
This function panics with a panic number of ECantProcessDescriptors.
TDes8 & aPDU | The datagram to process. |
TSockAddr * from | |
TSockAddr * to = NULL | |
CProtocolBase * aSourceProtocol = NULL | The higher level protocol which we want to process our incoming datagram. |
TInt | RefCount | ( | ) | const [inline] |
Reference counting by protocols created by protocol families.
IMPORT_C TInt | Send | ( | RMBufChain & | aPDU, |
CProtocolBase * | aSourceProtocol = NULL | |||
) | [virtual] |
This function panics with a panic number of ECantSendMBufs.
RMBufChain & aPDU | |
CProtocolBase * aSourceProtocol = NULL |
IMPORT_C TInt | Send | ( | TDes8 & | aPDU, |
TSockAddr * | to, | |||
TSockAddr * | from = NULL, | |||
CProtocolBase * | aSourceProtocol = NULL | |||
) | [virtual] |
This function panics with a panic number of ECantSendDescriptors.
TDes8 & aPDU | The datagram to be sent. |
TSockAddr * to | |
TSockAddr * from = NULL | |
CProtocolBase * aSourceProtocol = NULL | The protocol from which the data has been sent. |
IMPORT_C TInt | SetOption | ( | TUint | level, |
TUint | name, | |||
const TDesC8 & | option, | |||
CProtocolBase * | aSourceProtocol = NULL | |||
) | [virtual] |
Sets options for the protocol on behalf of socket server clients.
The option parameter is protocol-defined - this is a generic API.
The protocol is passed in because you might get SetOption() calls from multiple bindees and need to distinguish who is setting what.
TUint level | |
TUint name | |
const TDesC8 & option | |
CProtocolBase * aSourceProtocol = NULL | The protocol making the request. |
IMPORT_C void | StartL | ( | ) | [virtual] |
Indicates to a protocol that all binding has completed successfully and it can start processing datagrams. This is mainly of interest to the lowest levels of a protocol stack which would queue a read on the network media device driver in response to this call.
If a protocol cannot start to process data (for example it may not have bound correctly) it should leave.
This implementation does nothing.
IMPORT_C void | StartSending | ( | CProtocolBase * | aProtocol | ) | [virtual] |
Indicates that data can now be sent. Implementations can call bound higher-level protocols and service access points in turn.
With Send() , this function forms a flow control pair. A zero return from a Send() should flow control off the calling protocol. StartSending() acts as a flow control on.
This implementation does nothing.
CProtocolBase * aProtocol | The calling protocol |
IMPORT_C TPtrC | Tag | ( | ) |
Gets a TPtrC to the protocol's tag name. The default implementation returns the tag passed to Init().
void | TryDelete | ( | ) | [private] |
delete Protocol Base if ref count <0 Used from Protocol manager cleanup stack entries
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.