Symbian
Symbian OS Library

SYMBIAN OS V9.3

[Index] [Spacer] [Previous] [Next]



Location: telsess.h
Link against: telsess.lib

Class CTelnetSession

class CTelnetSession : public CBase;

Description

The main Symbian telnet class.

Consists of a connection interface and a protocol interface. The connection interface comprises member functions that: connect to, read from, write to and disconnect from a telnet server.

The protocol interface includes member functions that get and set telnet configuration.

Derivation

Members

Defined in CTelnetSession:
Connect(), Connect(), Connect(), Connect(), ConstructL(), Disconnect(), DoForceLogout(), DoModifyConfig(), NewL(), OptionStatus(), Read(), Write(), Write()

Inherited from CBase:
Delete(), Extension_(), operator new()


Construction and destruction


NewL()

static IMPORT_C CTelnetSession *NewL(const TTelnetConfig &aConfig, const MTelnetNotification *aNotifier);

Description

Allocates and constructs a new telnet session object.

Parameters

const TTelnetConfig &aConfig

The TTelnetConfig object to use. The client should derive from the TTelnetConfig class and pass this pointer into NewL().

const MTelnetNotification *aNotifier

The MTelnetNotification object to use. The client should derive from the MTelnetNotification class and pass this pointer into NewL().

Return value

CTelnetSession *

The newly created telnet session.


ConstructL()

protected: IMPORT_C void ConstructL(const TTelnetConfig &aConfig, const MTelnetNotification *aNotifier);

Description

Second-phase protected constructor, called by NewL().

Parameters

const TTelnetConfig &aConfig

const MTelnetNotification *aNotifier

See also:

[Top]


Member functions


Connect()

IMPORT_C TInt Connect(const TInetAddr &aNetAddr);

Description

Connects to aNetAddr on the standard telnet port (port 23).

Initiates connection to the specified IP address on the standard telnet port (port 23).

The client is asynchronously notified of successful connection by the MTelnetNotification::Connected() function.

Parameters

const TInetAddr &aNetAddr

The IP address to which connection is to be made.

Return value

TInt


Connect()

IMPORT_C TInt Connect(const TInetAddr &aNetAddr, TUint aPort);

Description

Connects to aNetAddr on user specified port.

Initiates connection to the specified IP address and telnet port.

The client is asynchronously notified of successful connection by the MTelnetNotification::Connected() function.

Parameters

const TInetAddr &aNetAddr

The address to which connection is to be made.

TUint aPort

The port through which connection is to be made.

Return value

TInt


Connect()

IMPORT_C TInt Connect(const TDesC &aServerName);

Description

Connects to aSeverName on the standard telnet port (port 23).

Connects to the specified server on the standard telnet port (port 23).

The client is asynchronously notified of successful connection by the MTelnetNotification::Connected() function.

Parameters

const TDesC &aServerName

The hostname of the server to which connection is to be made.

Return value

TInt


Connect()

IMPORT_C TInt Connect(const TDesC &aServerName, TUint aPort);

Description

Connects to aServerName on user specified port.

Connects to the specified server on the specified port.

The client is asynchronously notified of successful connection by the MTelnetNotification::Connected() function.

Parameters

const TDesC &aServerName

The hostname of the server to which connection is to be made.

TUint aPort

The port through which connection is to be made.

Return value

TInt


Disconnect()

IMPORT_C TInt Disconnect();

Description

Disconnects current connection.

Requests disconnection from the server.

Return value

TInt


Write()

IMPORT_C TInt Write(const TDesC8 &aBuffer);

Description

Writes a byte stream over the open telnet connection.

Writes a byte stream over the open telnet connection to the telnet server.

The client is notified asynchronously by the:

Parameters

const TDesC8 &aBuffer

The data to write.

Return value

TInt


Write()

IMPORT_C TInt Write(TTelnetUserControl &aControlCode);

Description

Writes NVT code to stream. Prepends <IAC> code (255).

Writes telnet-defined code over the open telnet connection to the telnet server.

The client is asynchronously notified by the:

Parameters

TTelnetUserControl &aControlCode

The telnet control code to write. See TTelnetUserControl enum.

Return value

TInt


Read()

IMPORT_C TInt Read();

Description

Read data received over telnet buffer.

Reads the data received over the telnet buffer.

The client is asynchronously notified by the:*

Return value

TInt


DoForceLogout()

IMPORT_C TInt DoForceLogout();

Description

Forces a logout from the server.

Return value

TInt


DoModifyConfig()

IMPORT_C TInt DoModifyConfig(TTelnetConfig &aConfig);

Description

Sets the telnet connection configuration.

If any options change status as a result, the client is notified through an OptionsChanged() call.

Parameters

TTelnetConfig &aConfig

Telnet connection configuration.

Return value

TInt

KErrNone, if successful; otherwise, one of the system wide error codes.


OptionStatus()

IMPORT_C TInt OptionStatus(TOptionStatus &aStatus);

Description

Gets the status of the supported RFC-defined options.

See TOptionStatus for a description of options.

Parameters

TOptionStatus &aStatus

On return, the status of the RFC-defined options.

Return value

TInt