Symbian
Symbian Developer Library

SYMBIAN OS V9.4

Feedback

[Index] [Previous] [Next]

#include <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:

Inherited from CBase:


Construction and destruction


NewL(const TTelnetConfig &,const MTelnetNotification *)

IMPORT_C static 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 CTelnetSession::NewL(const TTelnetConfig &,const MTelnetNotification *).

const MTelnetNotification *aNotifier

The MTelnetNotification object to use. The client should derive from the MTelnetNotification class and pass this pointer into CTelnetSession::NewL(const TTelnetConfig &,const MTelnetNotification *).

Return value

CTelnetSession *

The newly created telnet session.


ConstructL(const TTelnetConfig &,const MTelnetNotification *)

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

Description

Second-phase protected constructor, called by CTelnetSession::NewL(const TTelnetConfig &,const MTelnetNotification *).

Parameters

const TTelnetConfig &aConfig

const MTelnetNotification *aNotifier

See also:

[Top]


Member functions


Connect(const TInetAddr &)

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(const TInetAddr &,TUint)

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(const TDesC &)

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 TDesC16 &aServerName

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

Return value

TInt


Connect(const TDesC &,TUint)

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 TDesC16 &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(const TDesC8 &)

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(TTelnetUserControl &)

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(TTelnetConfig &)

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(TOptionStatus &)

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