Exemplo n.º 1
0
    MySocket(ISocketHandler& h) : TcpSocket(h) {
        SetLineProtocol();
#ifdef HAVE_OPENSSL
        if (g_b_ssl)
            EnableSSL();
#endif
        if (g_b_nobuf)
            DisableInputBuffer();
    }
Exemplo n.º 2
0
HTTPSocket::HTTPSocket(ISocketHandler& h)
:TcpSocket(h)
,m_first(true)
,m_header(true)
,m_http_version("HTTP/1.0")
,m_request(false)
,m_response(false)
,m_body_size_left(0)
,m_b_http_1_1(false)
,m_b_keepalive(false)
,m_b_chunked(false)
,m_chunk_size(0)
,m_chunk_state(0)
{
	SetLineProtocol();
	DisableInputBuffer();
}
/*-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-*/


#include "CommonInclude.h"
#include "GeneralAgentTcpSocket.h"

#include <string.h> /* memset */
#include <str_opr.h> /* dump */
CGeneralAgentTcpSocket::CGeneralAgentTcpSocket(ISocketHandler& h, std::string strSocketName) : TcpSocket(h)
{
    // 由Handle自己管理
    SetDeleteByHandler();
    // 数据不缓存
#ifdef USE_DATAPARSE_EXAMPLE

    memset(&m_headLastOn, 0, sizeof(WIFI_AGENT_PROTOCOL_HEAD));
#else

    DisableInputBuffer();
#endif //USE_DATAPARSE_EXAMPLE

    m_tOnData = 0;

    SetSockName(strSocketName);
}