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;
81 MessagingPort(
double so_timeout = 0, logger::LogSeverity logLevel = logger::LogSeverity::Log());
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);
129 bool connect(SockAddr& farEnd) {
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;
158 mutable HostAndPort _remoteParsed;
161 static void closeAllSockets(
unsigned tagMask = 0xffffffff);
163 friend class PiggyBackData;
Definition message_port.h:34
Definition message_port.h:74
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:37
wrapped around os representation of network address
Definition sock.h:96