libcsdbg  1.28
C++ exception (and generic) stack trace debug library
csdbg::tcpsockbuf::tcpsockbuf ( const i8 addr,
i32  port = g_ldp_port 
)
explicit

Object constructor.

Parameters
[in]addrthe peer (server) IP address (localhost if NULL is passed)
[in]portthe peer TCP port
Exceptions
std::bad_alloc

Definition at line 24 of file tcpsockbuf.cpp.

References m_address, and unlikely.

Referenced by clone().

25  :
26 streambuf(),
27 m_address(NULL),
28 m_port(port)
29 {
30  if ( unlikely(addr == NULL || strlen(addr) == 0) )
31  addr = "127.0.0.1";
32 
33  m_address = new i8[strlen(addr) + 1];
34  strcpy(m_address, addr);
35 }
36 
37 catch (...) {
38  delete[] m_data;
39  m_data = NULL;
40  m_address = NULL;
41 }
char i8
8-bit signed integer
Definition: config.hpp:72
i8 * m_address
Peer IP address (numerical, IPv4)
Definition: tcpsockbuf.hpp:40
i32 m_port
Peer TCP port.
Definition: tcpsockbuf.hpp:42
streambuf()
Object default constructor.
Definition: streambuf.cpp:20
i8 * m_data
String data.
Definition: string.hpp:42
virtual i32 port() const
Get the peer TCP port.
Definition: tcpsockbuf.cpp:111
#define unlikely(expr)
Offer a hint (negative) to the pipeline branch predictor.
Definition: config.hpp:349

+ Here is the caller graph for this function: