mongo::Socket Class Reference

thin wrapped around file descriptor and system calls todo: ssl More...

#include <sock.h>

Inheritance diagram for mongo::Socket:
mongo::MessagingPort

List of all members.

Public Member Functions

 Socket (int sock, const SockAddr &farEnd)
 Socket (double so_timeout=0, int logLevel=0)
 In some cases the timeout will actually be 2x this value - eg we do a partial send, then the timeout fires, then we try to send again, then the timeout fires again with no data sent, then we detect that the other side is down.
bool connect (SockAddr &farEnd)
void close ()
void send (const char *data, int len, const char *context)
void send (const vector< pair< char *, int > > &data, const char *context)
void recv (char *data, int len)
int unsafe_recv (char *buf, int max)
int getLogLevel () const
void setLogLevel (int ll)
SockAddr remoteAddr () const
string remoteString () const
unsigned remotePort () const
void clearCounters ()
long long getBytesIn () const
long long getBytesOut () const
void setTimeout (double secs)
void postFork ()
 call this after a fork for server sockets

Protected Attributes

int _logLevel

Detailed Description

thin wrapped around file descriptor and system calls todo: ssl


Constructor & Destructor Documentation

mongo::Socket::Socket ( double  so_timeout = 0,
int  logLevel = 0 
)

In some cases the timeout will actually be 2x this value - eg we do a partial send, then the timeout fires, then we try to send again, then the timeout fires again with no data sent, then we detect that the other side is down.

Generally you don't want a timeout, you should be very prepared for errors if you set one.


The documentation for this class was generated from the following files:
Generated on Wed Sep 14 01:46:41 2011 for MongoDB by  doxygen 1.6.3