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"
42 MSGID responseTo) = 0;
46 virtual unsigned remotePort()
const = 0;
47 virtual SockAddr remoteAddr()
const = 0;
48 virtual SockAddr localAddr()
const = 0;
50 void setX509SubjectName(
const std::string& x509SubjectName) {
51 _x509SubjectName = x509SubjectName;
54 std::string getX509SubjectName() {
55 return _x509SubjectName;
58 long long connectionId()
const {
61 void setConnectionId(
long long connectionId);
70 long long _connectionId;
71 std::string _x509SubjectName;
87 void setSocketTimeout(
double timeout);
95 void reply(
Message& received,
Message& response, MSGID responseTo);
99 void say(
Message& toSend,
int responseTo = 0);
112 void piggyBack(
Message& toSend,
int responseTo = 0);
114 unsigned remotePort()
const {
115 return psock->remotePort();
118 virtual SockAddr remoteAddr()
const;
121 boost::shared_ptr<Socket> psock;
123 void send(
const char* data,
int len,
const char* context) {
124 psock->send(data, len, context);
126 void send(
const std::vector<std::pair<char*, int> >& data,
const char* context) {
127 psock->send(data, context);
130 return psock->connect(farEnd);
140 bool secure(SSLManagerInterface* ssl,
const std::string& remoteHost) {
141 return psock->secure(ssl, remoteHost);
145 bool isStillConnected() {
146 return psock->isStillConnected();
149 uint64_t getSockCreationMicroSec()
const {
150 return psock->getSockCreationMicroSec();
154 PiggyBackData* piggyBackData;
161 static void closeAllSockets(
unsigned tagMask = 0xffffffff);
163 friend class PiggyBackData;
Definition: message_port.h:34
Definition: message.h:305
Utility functions for parsing numbers from strings.
Definition: compare_numbers.h:20
wrapped around os representation of network address
Definition: sock.h:96
Name of a process on the network.
Definition: hostandport.h:37
Representation of the severity / priority of a log message.
Definition: log_severity.h:33
Definition: message_port.h:74