#include <CHMllpConnection.h>
This class provides methods to interact with each discrete client connection.
See http://www.interfaceware.com/manual/network_components.html for more information.
Public Member Functions | |
CHMllpConnection () | |
Constructor. | |
virtual | ~CHMllpConnection () |
Destructor. | |
CHMllpConnection & | operator= (const CHMllpConnection &Orig) |
Assignment operator. | |
CHMconnectionHandle | GetHandle () const |
This method is part of the internal implementation of this class and should not be called. | |
const char * | RemoteHostName () const |
This property will resolve the remoteIpAddress to the host name if possible using the operating system. | |
CHMint32 | Id () const |
A unique ID for all connection objects. | |
CHMint32 | RemoteIpAddress () const |
The IP address of the remote host in host byte order. | |
const char * | RemoteIpAddressAsString () const |
The IP address of the remote host as a string. | |
void | TransmitMessage (const char *Message) |
Send a message to the client, prefixed and postfixed by the current CHMllpServer::HeaderBlock and CHMllpServer::TrailerBlock characters. | |
void | Disconnect () |
Attempt to gracefully disconnect from the server. | |
void | HardDisconnect () |
Ungracefully disconnect without doing TCP/IP handshaking with the server. |
|
Constructor.
|
|
Destructor.
|
|
Attempt to gracefully disconnect from the server. A graceful disconnect implies a shutdown to the write end of the connection, and reading all data until the peer issues a close to its write end. Note that the peer may not actually close the write end of its connection (although this is rare), which results in the connection never receiving the close event to signify that the connection is closed. In this situation, it is recommended that CHMllpConnection::HardDisconnect be called to close the connection. Function requires a running message loop (see CHMllpServer::RunMessageLoop).
Blocking: Function does not block. |
|
This method is part of the internal implementation of this class and should not be called.
|
|
Ungracefully disconnect without doing TCP/IP handshaking with the server. If there is data pending on the network buffer to be sent, the peer will receive a reset on the connection if it attempts to read or write to the connection.
Blocking: Function blocks; upon returning, the connection is closed. |
|
A unique ID for all connection objects. This ID is generated sequentially (i.e. 0, 1, 2, 3, etc.) for all connections received from a LlpServer, beginning at 0 when the application starts. The ID is globally unique and will allow users to identify connections from the same client, or connections from different clients. |
|
Assignment operator.
|
|
This property will resolve the remoteIpAddress to the host name if possible using the operating system. Sometimes no host name resolution will be possible at which point this function will return 'unknown'. For the first time this method is called, it blocks until the name is resolved. This means that if you make the call in the context of your message loop your application will appear to freeze for a few seconds. Subsequent calls will return immediately with a cached value. For more advanced functionality you may wish to use other facilities to resolve the host name outside of the functionality offered here. |
|
The IP address of the remote host in host byte order. Consider using CHMllpConnection::RemoteIpAddressAsString instead for a more usable format. |
|
The IP address of the remote host as a string. See also CHMllpConnection::RemoteIpAddress. |
|
Send a message to the client, prefixed and postfixed by the current CHMllpServer::HeaderBlock and CHMllpServer::TrailerBlock characters. The data is not guaranteed to be received after this function is called. All data is buffered internally; completion of this call does not signify reception of data. Function requires a running message loop (see CHMllpServer::RunMessageLoop).
Blocking: Function does not block.
|