EHS Embedded HTTP Server  1.5.0.132
EHSConnection Class Reference

EHSConnection abstracts the concept of a connection to an EHS application. More...

#include <ehsconnection.h>

List of all members.

Public Member Functions

std::string GetRemoteAddress () const
 returns the remote address of the connection.
int GetRemotePort () const
 returns the remote port of the connection.
std::string GetLocalAddress () const
 returns the local address of the connection.
int GetLocalPort () const
 returns the local port of the connection.
std::string GetAddress () const
 returns address of the connection.
int GetPort () const
 returns client port of the connection.
bool Disconnected () const
 returns whether the client has disconnected from us.
bool IsRaw () const
 returns whether the this connection is in raw mode.
void AddResponse (ehs_autoptr< GenericResponse > ehs_rvref response)
 adds a response to the response list and sends as many responses as are ready
void EnableIdleTimeout (bool enable=true)
 Enable/Disable idle-timeout handling for this connection.
void EnableKeepAlive (bool enable=true)
 Enable/Disable TCP keepalive on the underlying socket.

Friends

class EHSServer

Detailed Description

EHSConnection abstracts the concept of a connection to an EHS application.

It stores file descriptor information, unhandled data, and the current state of the request

Examples:

ehs_wsgate.cpp.


Member Function Documentation

void EnableIdleTimeout ( bool  enable = true) [inline]

Enable/Disable idle-timeout handling for this connection.

Parameters:
enableIf true, idle-timeout handling is enabled, otherwise the socket may stay open forever. When creating an EHSConnection, this is initially enabled.

Definition at line 140 of file ehsconnection.h.

void EnableKeepAlive ( bool  enable = true)

Enable/Disable TCP keepalive on the underlying socket.

This enables detection of "dead" sockets, even when idle-timeout handling is disabled.

Parameters:
enableIf true, enable TCP keepalive. When creating an EHSConnection, this is initially disabled.
std::string GetAddress ( ) const [inline]

returns address of the connection.

Deprecated:
Use GetRemoteAddress()

Definition at line 116 of file ehsconnection.h.

References GetRemoteAddress().

+ Here is the call graph for this function:

int GetPort ( ) const [inline]

returns client port of the connection.

Deprecated:
Use GetRemotePort()

Definition at line 123 of file ehsconnection.h.

References GetRemotePort().

+ Here is the call graph for this function:


The documentation for this class was generated from the following file: