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:
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:
See also:
Purpose:
The constructor creates the object.
Access :
Prototype:
LTCPEndpoint();Parameters:
Purpose:
The destructor destroys the LTCPEndpoint object.
Access :
Prototype:
virtual ~LTCPEndpoint();
Purpose:
Called for a disconnect on abort. You must override this and provide functionality if you inherit from this class.
Access :
Prototype:
virtual void AbortiveDisconnect() = 0;Parameters:
Return:
Purpose:
Call to accept an incoming connection.
Access :
Prototype:
virtual void AcceptIncoming(
LTCPEndpoint* inEndpoint ) = 0; The parameters for this method are:
| LTCPEndpoint* | inEndpoint | The endpoint. |
Return:
Purpose:
Called for accepting a remote disconnect.
Access :
Prototype:
virtual void AcceptRemoteDisconnect() = 0;Parameters:
Return:
Purpose:
Access :
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:
Purpose:
Access :
Prototype:
virtual void Disconnect() = 0;Parameters:
Return:
Purpose:
Learn how much unread data remains.
Access :
Prototype:
virtual UInt32 GetAmountUnread() = 0;Parameters:
Return:
Returns the amount of unread data.
Purpose:
Retrieve the address of the remote host.
Access :
Prototype:
virtual LInternetAddress * GetRemoteHostAddress() = 0;Parameters:
Return:
A pointer to the LInternetAddress.
Purpose:
Access :
Prototype:
virtual void Listen() = 0;Parameters:
Return:
Purpose:
Access :
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:
Purpose:
Access :
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.
Purpose:
Receive data over a connection.
Access :
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:
Purpose:
Receive data until a specified character is found.
Access :
Prototype:
virtual Boolean ReceiveDataUntilMatch(
void* outDataBuffer,
UInt32& ioDataSize,
Boolean& outExpedited,
UInt32 inTimeoutSeconds,
char inMatchChar = 0x0D );Parameters:
The parameters for this method are:
Return:
Returns true if the specified character is found before the timeout, else returns false.
Purpose:
Access :
Prototype:
virtual Boolean ReceiveLine(
char * outString,
UInt32& ioDataSize,
UInt32 inTimeoutSeconds,
Boolean inUseLF = false );Parameters:
The parameters for this method are:
Return:
Returns the value of ReceiveDataUntilMatch().
Purpose:
Access :
Prototype:
void RejectIncoming() = 0;Parameters:
Return:
Purpose:
Calls SendData() to send data.
Access :
Prototype:
virtual void Send( void* inData,
UInt32 inDataSize ); The parameters for this method are:
| void* | inData | The buffer pointer to send. |
| UInt32& | inDataSize | The data size. |
Return:
Purpose:
Utility method for SendData().
Access :
Prototype:
virtual void SendCStr(char* inString);Parameters:
The parameters for this method are:
| char* | inString | The C string to send. |
Return:
Purpose:
A routine to actually send the data out.
Access :
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:
Purpose:
Access :
Prototype:
virtual void SendDisconnect() = 0;Parameters:
Return:
Purpose:
Utility method for SendData().
Access :
Prototype:
virtual void SendHandle(Handle inHandle);Parameters:
The parameter for this method is:
| Handle | inHandle | The handle to send. |
Return:
Purpose:
Utility method for SendData().
Access :
Prototype:
virtual void SendPStr(ConstStringPtr inString);Parameters:
The parameter for this method is:
| ConstStringPtr | inString | The Pascal string to send. |
Return:
Purpose:
Utility method for SendData().
Access :
Prototype:
virtual void SendPtr(Ptr inPtr);Parameters:
The parameter for this method is:
| ConstStringPtr | inString | The data to send. |
Return: