[ First ]  [ Previous ]  [ Next ]  [ Last ]  [ Manuals ]

 

LTCPEndpoint



Overview:

LTCPEndpoint is a PowerPlant class that is used for implementing Internet TCP endpoints. TCP/IP is the session-oriented protocol of the Internet, and is the layer upon which most of the familiar Internet protocols (HTTP, FTP, SMTP, etc.) are built.

Methods :

The methods in this class are:

 

LTCPEndpoint()  
~LTCPEndpoint()  
AbortiveDisconnect()  
AcceptIncoming()  
AcceptRemoteDisconnect()  
Connect()  
Disconnect()  
GetAmountUnread()  
GetRemoteHostAddress()  
Listen()  
Receive()  
ReceiveChar()  
ReceiveData()  
ReceiveDataUntilMatch()  
ReceiveLine()  
RejectIncoming()  
Send()  
SendCStr()  
SendData()  
SendDisconnect()  
SendHandle()  
SendPStr()  
SendPtr()  
 

Data Members:

There are no data members in this class.

 

Operation:

In PowerPlant, there are two subclasses of LTCPEndpoint, named LMacTCPTCPEndpoint and LOpenTptTCPEndpoint. The appropriate class is created automatically when you call UNetworkFactory::CreateTCPEndpoint().

Note that most of these methods are pure virtual, requiring you to implement them if you inherit from this class.

Source files:

(Networking Classes)

LTCPEndpoint.h

LTCPEndpoint.cp

See also:

LEndpoint

LMacTCPTCPEndpoint

LOpenTptTCPEndpoint

LTCPEndpoint()

Purpose:

The constructor creates the object.

Access :

Public

Prototype:

LTCPEndpoint();
Parameters:

None

~LTCPEndpoint()

Purpose:

The destructor destroys the LTCPEndpoint object.

Access :

Virtual, Public

Prototype:

virtual ~LTCPEndpoint();

AbortiveDisconnect()

Purpose:

Called for a disconnect on abort. You must override this and provide functionality if you inherit from this class.

Access :

Pure virtual, Public

Prototype:

virtual void AbortiveDisconnect() = 0;
Parameters:

None

Return:

None

AcceptIncoming()

Purpose:

Call to accept an incoming connection.

Access :

Pure virtual, Public

Prototype:

virtual void AcceptIncoming(
   LTCPEndpoint* inEndpoint ) = 0;
Parameters:

The parameters for this method are:

 

LTCPEndpoint* inEndpoint The endpoint.

Return:

None

AcceptRemoteDisconnect()

Purpose:

Called for accepting a remote disconnect.

Access :

Pure virtual, Public

Prototype:

virtual void AcceptRemoteDisconnect() = 0;
Parameters:

None

Return:

None

Connect()

Purpose:

Called to connect.

Access :

Pure virtual, Public

Prototype:

virtual void Connect(

	LInternetAddress& inRemoteAddress,

	UInt32 inTimeoutSeconds = Timeout_None ) = 0;
Parameters:

The parameters for this method are:

 

LInternetAddress& inRemoteAddress The address.
UInt32 inTimeoutSeconds The timeout value, default is Timeout_None.

Return:

None

Disconnect()

Purpose:

Called to disconnect.

Access :

Pure virtual, Public

Prototype:

virtual void Disconnect() = 0;
Parameters:

None

Return:

None

GetAmountUnread()

Purpose:

Learn how much unread data remains.

Access :

Pure virtual, Public

Prototype:

virtual UInt32 GetAmountUnread() = 0;
Parameters:

None

Return:

Returns the amount of unread data.

GetRemoteHostAddress()

Purpose:

Retrieve the address of the remote host.

Access :

Pure virtual, Public

Prototype:

virtual LInternetAddress *	GetRemoteHostAddress() = 
0;
Parameters:

None

Return:

A pointer to the LInternetAddress.

Listen()

Purpose:

Listen for data.

Access :

Pure virtual, Public

Prototype:

virtual void Listen() = 0;
Parameters:

None

Return:

None

Receive()

Purpose:

Receive data.

Access :

Pure virtual, Public

Prototype:

virtual void Receive( void* outDataBuffer, UInt32& 
ioDataSize );
Parameters:

The parameters for this method are:

 

void* outDataBuffer The buffer pointer.
UInt32& ioDataSize The data size.

Return:

None

ReceiveChar()

Purpose:

Receive a character.

Access :

Virtual, Public

Prototype:

virtual Boolean ReceiveChar( char& outChar, UInt32 	

	inTimeoutSeconds = Timeout_None);
Parameters:

The parameters for this method are:

 

char& outChar The buffer pointer.
UInt32 inTimeoutSeconds The timeout, the default is Timeout_None.

Return:

Return true if a character is received.

ReceiveData()

Purpose:

Receive data over a connection.

Access :

Pure virtual, Public

Prototype:

virtual void ReceiveData( void* outDataBuffer,

	UInt32& ioDataSize,

	Boolean& outExpedited,

	UInt32 inTimeoutSeconds = Timeout_None) = 0;
Parameters:

The parameters for this method are:

 

void* outDataBuffer The buffer pointer.
UInt32 ioDataSize The data size.
Boolean& outExpedited Whether expedited or not.
UInt32 inTimeoutSeconds The timeout, the default is Timeout_None.

Return:

None

ReceiveDataUntilMatch()

Purpose:

Receive data until a specified character is found.

Access :

Virtual, Public

Prototype:

virtual Boolean ReceiveDataUntilMatch(

	void* outDataBuffer,

	UInt32& ioDataSize,

	Boolean& outExpedited,

	UInt32 inTimeoutSeconds,

	char inMatchChar = 0x0D );
Parameters:

The parameters for this method are:

 

void* outDataBuffer The buffer pointer.
UInt32 ioDataSize The data size.
Boolean& outExpedited Whether expedited or not.
UInt32 inTimeoutSeconds The timeout, the default is Timeout_None.
char inMatchChar The character to search for, the default is 0x0D.

Return:

Returns true if the specified character is found before the timeout, else returns false.

ReceiveLine()

Purpose:

Receive a line of data.

Access :

Virtual, Public

Prototype:

virtual Boolean ReceiveLine(

	char * outString,

	UInt32& ioDataSize,

	UInt32 inTimeoutSeconds,

	Boolean inUseLF = false );
Parameters:

The parameters for this method are:

 

char* outString The buffer pointer to fill.
UInt32& ioDataSize The data size.
UInt32 inTimeoutSeconds The timeout, the default is Timeout_None.
Boolean inUseLF Whether to use a line feed or not, the default is false. If true then we look for a LF instead of CR to terminate the line.

Return:

Returns the value of ReceiveDataUntilMatch().

RejectIncoming()

Purpose:

Call to reject incoming data.

Access :

Pure virtual, Public

Prototype:

void RejectIncoming() = 0;
Parameters:

None

Return:

None

Send()

Purpose:

Calls SendData() to send data.

Access :

Virtual, Public

Prototype:

virtual void Send( void* inData, 
   UInt32 inDataSize );
Parameters:

The parameters for this method are:

 

void* inData The buffer pointer to send.
UInt32& inDataSize The data size.

Return:

None

SendCStr()

Purpose:

Utility method for SendData().

Access :

Virtual, Public

Prototype:

virtual void SendCStr(char* inString);
Parameters:

The parameters for this method are:

 

char* inString The C string to send.

Return:

None

SendData()

Purpose:

A routine to actually send the data out.

Access :

Pure virtual, Public

Prototype:

virtual void SendData( void* inData,

	UInt32 inDataSize,

	Boolean inExpedited = false,

	UInt32 inTimeoutSeconds = Timeout_None ) = 0;
Parameters:

The parameters for this method are:

 

void* inData The data to send.
UInt32 inDataSize The data size.
Boolean inExpedited Whether to expedite or not, default is false.
UInt32 inTimeoutSeconds The timeout, default is Timeout_None.

Return:

None

SendDisconnect()

Purpose:

Send a disconnect.

Access :

Pure virtual, Public

Prototype:

virtual void SendDisconnect() = 0;
Parameters:

None

Return:

None

SendHandle()

Purpose:

Utility method for SendData().

Access :

Virtual, Public

Prototype:

virtual void SendHandle(Handle inHandle);
Parameters:

The parameter for this method is:

 

Handle inHandle The handle to send.

Return:

None

SendPStr()

Purpose:

Utility method for SendData().

Access :

Virtual, Public

Prototype:

virtual void SendPStr(ConstStringPtr inString);
Parameters:

The parameter for this method is:

 

ConstStringPtr inString The Pascal string to send.

Return:

None

SendPtr()

Purpose:

Utility method for SendData().

Access :

Virtual, Public

Prototype:

virtual void SendPtr(Ptr inPtr);
Parameters:

The parameter for this method is:

 

ConstStringPtr inString The data to send.

Return:

None

 


[ First ]  [ Previous ]  [ Next ]  [ Last ]  [ Manuals ]

Visit the Metrowerks website at: http://www.metrowerks.com
For assistance contact Metrowerks Technical Support at: cw_support@metrowerks.com
Copyright © 2000, Metrowerks Corp. All rights reserved.

Last updated: July 21, 2000