20#include "mongo/config.h"
22#include <boost/shared_ptr.hpp>
23#include <boost/utility.hpp>
26#include "mongo/util/net/message.h"
27#include "mongo/util/net/sock.h"
38 virtual void reply(
Message& received,
Message& response, MSGID responseTo) = 0;
42 virtual unsigned remotePort()
const = 0;
43 virtual SockAddr remoteAddr()
const = 0;
44 virtual SockAddr localAddr()
const = 0;
46 void setX509SubjectName(
const std::string& x509SubjectName) {
47 _x509SubjectName = x509SubjectName;
50 std::string getX509SubjectName() {
51 return _x509SubjectName;
54 long long connectionId()
const {
return _connectionId; }
55 void setConnectionId(
long long connectionId );
64 long long _connectionId;
65 std::string _x509SubjectName;
76 logger::LogSeverity logLevel = logger::LogSeverity::Log() );
82 void setSocketTimeout(
double timeout);
90 void reply(
Message& received,
Message& response, MSGID responseTo);
94 void say(
Message& toSend,
int responseTo = 0);
107 void piggyBack(
Message& toSend ,
int responseTo = 0 );
109 unsigned remotePort()
const {
return psock->remotePort(); }
111 virtual SockAddr remoteAddr()
const;
114 boost::shared_ptr<Socket> psock;
116 void send(
const char * data ,
int len,
const char *context ) {
117 psock->send( data, len, context );
119 void send(
const std::vector< std::pair< char *, int > > &data,
const char *context) {
120 psock->send( data, context );
122 bool connect(SockAddr& farEnd) {
123 return psock->connect( farEnd );
133 bool secure( SSLManagerInterface* ssl,
const std::string& remoteHost ) {
134 return psock->secure( ssl, remoteHost );
138 bool isStillConnected() {
139 return psock->isStillConnected();
142 uint64_t getSockCreationMicroSec()
const {
143 return psock->getSockCreationMicroSec();
148 PiggyBackData * piggyBackData;
152 mutable HostAndPort _remoteParsed;
155 static void closeAllSockets(
unsigned tagMask = 0xffffffff);
157 friend class PiggyBackData;
Definition message_port.h:34
Definition message_port.h:68
bool recv(const Message &sent, Message &response)
this is used for doing 'async' queries instead of doing call( to , from ) you would do say( to ) recv...
the main MongoDB namespace
Definition bulk_operation_builder.h:24
Name of a process on the network.
Definition hostandport.h:36
wrapped around os representation of network address
Definition sock.h:94