13 #include <sys/types.h> 18 #include <epicsVersion.h> 29 #define epicsExportSharedSymbols 50 virtual ~BreakTransport() {}
61 size_t Transport::num_instances;
63 Transport::Transport()
77 const std::size_t AbstractCodec::MAX_MESSAGE_PROCESS = 100;
78 const std::size_t AbstractCodec::MAX_MESSAGE_SEND = 100;
79 const std::size_t AbstractCodec::MAX_ENSURE_SIZE = 1024;
80 const std::size_t AbstractCodec::MAX_ENSURE_DATA_SIZE = MAX_ENSURE_SIZE/2;
81 const std::size_t AbstractCodec::MAX_ENSURE_BUFFER_SIZE = MAX_ENSURE_SIZE;
82 const std::size_t AbstractCodec::MAX_ENSURE_DATA_BUFFER_SIZE = 1024;
85 size_t bufSizeSelect(
size_t request)
90 AbstractCodec::AbstractCodec(
92 size_t sendBufferSize,
93 size_t receiveBufferSize,
94 int32_t socketSendBufferSize,
95 bool blockingProcessQueue):
97 _readMode(
NORMAL), _version(0), _flags(0), _command(0), _payloadSize(0),
101 _writeOpReady(
false),
102 _socketBuffer(bufSizeSelect(receiveBufferSize)),
103 _sendBuffer(bufSizeSelect(sendBufferSize)),
105 _storedPayloadSize(0), _storedPosition(0), _startPosition(0),
107 _lastMessageStartPosition(
std::numeric_limits<size_t>::
max()),_lastSegmentedMessageType(0),
108 _lastSegmentedMessageCommand(0), _nextMessagePayloadOffset(0),
110 _clientServerFlag(serverFlag ? 0x40 : 0x00)
113 throw std::invalid_argument(
114 "receiveBuffer.capacity() < 2*MAX_ENSURE_SIZE");
117 throw std::invalid_argument(
"sendBuffer() < 2*MAX_ENSURE_SIZE");
136 processReadSegmented();
139 throw std::logic_error(
"ReadMode == SPLIT not supported");
145 void AbstractCodec::processHeader() {
173 "Invalid header received from the client : %s %02x%02x%02x%02x disconnecting...",
183 void AbstractCodec::processReadNormal() {
187 std::size_t messageProcessCount = 0;
198 bool isControl = ((
_flags & 0x01) == 0x01);
205 bool notFirstSegment = (
_flags & 0x20) != 0;
214 "Protocol Violation: Not-a-first segmented message received in normal mode" 215 " from the client at %s:%d: %s, disconnecting...",
219 "not-a-first segmented message received in normal mode");
226 bool postProcess =
true;
236 postProcessApplicationMessage();
245 postProcessApplicationMessage();
264 void AbstractCodec::postProcessApplicationMessage()
273 std::size_t newPosition = _storedPosition + _storedPayloadSize;
280 if (newPosition > _storedLimit)
299 "unprocessed read buffer from client at %s:%d: %s," 304 "unprocessed read buffer");
312 void AbstractCodec::processReadSegmented() {
323 bool isControl = ((
_flags & 0x01) == 0x01);
333 bool notFirstSegment = (
_flags & 0x20) != 0;
334 if (!notFirstSegment)
337 "Protocol Violation: Not-a-first segmented message expected from the client at" 338 " %s:%d: %s, disconnecting...",
342 "not-a-first segmented message expected");
355 bool AbstractCodec::readToBuffer(
356 std::size_t requiredBytes,
361 if (remainingBytes >= requiredBytes) {
377 std::size_t endPosition = _startPosition + remainingBytes;
379 for (std::size_t
i = _startPosition;
i < endPosition;
i++)
387 std::size_t requiredPosition = _startPosition + requiredBytes;
398 else if (bytesRead == 0)
431 std::ostringstream msg;
432 msg <<
"requested for buffer size " << size
435 "%s at %s:%d.,", msg.str().c_str(), __FILE__, __LINE__);
436 throw std::invalid_argument(msg.str());
444 _storedPayloadSize -= pos - _storedPosition;
450 if (_storedPayloadSize >= (_storedLimit-pos))
457 readToBuffer(size,
true);
462 std::min<std::size_t>(
463 _storedPosition + _storedPayloadSize, _storedLimit));
483 for (std::size_t
i = 0;
i < remainingBytes;
i++)
499 readToBuffer(size - remainingBytes,
true);
507 for (int32_t
i = remainingBytes - 1,
514 _storedPayloadSize += remainingBytes;
515 _storedPosition = _startPosition;
518 std::min<std::size_t>(
519 _storedPosition + _storedPayloadSize, _storedLimit));
532 "Failed to ensure data to read buffer.");
539 std::size_t alignment) {
541 std::size_t k = (alignment - 1);
542 return (value + k) & (~k);
548 std::size_t k = (alignment - 1);
550 std::size_t newpos = (pos + k) & (~k);
568 static const char PADDING_BYTES[] =
570 static_cast<char>(0xFF),
571 static_cast<char>(0xFF),
572 static_cast<char>(0xFF),
573 static_cast<char>(0xFF),
574 static_cast<char>(0xFF),
575 static_cast<char>(0xFF),
576 static_cast<char>(0xFF),
577 static_cast<char>(0xFF)
582 std::size_t k = (alignment - 1);
584 std::size_t newpos = (pos + k) & (~k);
589 std::size_t padCount = newpos - pos;
596 std::size_t ensureCapacity,
598 _lastMessageStartPosition =
611 if (_nextMessagePayloadOffset > 0)
621 _lastMessageStartPosition =
644 std::size_t payloadSize =
645 lastPayloadBytePosition -
651 if (hasMoreSegments) {
653 if (_lastSegmentedMessageType == 0)
655 std::size_t flagsPosition = _lastMessageStartPosition + 2;
660 _lastSegmentedMessageType = type | 0x30;
661 _lastSegmentedMessageCommand =
664 _nextMessagePayloadOffset = 0;
669 if (_lastSegmentedMessageType != 0)
671 std::size_t flagsPosition = _lastMessageStartPosition + 2;
674 (_lastSegmentedMessageType & 0xEF));
675 _lastSegmentedMessageType = 0;
677 _nextMessagePayloadOffset = 0;
707 if (_maxSendPayloadSize < size) {
708 std::ostringstream msg;
709 msg <<
"requested for buffer size " <<
710 size <<
", but only " << _maxSendPayloadSize <<
" available.";
711 std::string s = msg.str();
713 "%s at %s:%d.,", msg.str().c_str(), __FILE__, __LINE__);
714 throw std::invalid_argument(s);
756 if (!lastMessageCompleted && _lastSegmentedMessageType != 0)
783 std::size_t maxBytesToSend = (size_t)-1;
787 std::size_t limit = buffer->
getLimit();
788 std::size_t bytesToSend = limit - buffer->
getPosition();
791 if (bytesToSend > maxBytesToSend)
793 bytesToSend = maxBytesToSend;
802 int bytesSent =
write(buffer);
810 else if (bytesSent == 0)
819 if (bytesToSend == maxBytesToSend)
823 if(bytesToSend > maxBytesToSend)
824 bytesToSend = maxBytesToSend;
837 std::size_t senderProcessed = 0;
840 TransportSender::shared_pointer sender;
842 if (sender.get() == 0)
857 processSender(sender);
874 TransportSender::shared_pointer
const & sender) {
886 void AbstractCodec::processSender(
887 TransportSender::shared_pointer
const & sender)
904 atomic::add(sender->bytesTX, after - before);
909 catch (std::exception &e ) {
911 std::ostringstream msg;
912 msg <<
"an exception caught while processing a send message: " 915 msg.str().c_str(), __FILE__, __LINE__);
929 TransportSender::shared_pointer
const & sender,
930 std::size_t requiredBufferSize) {
936 processSender(sender);
982 startMessage(_lastSegmentedMessageCommand, 0, static_cast<int32>(count));
992 ByteBuffer wrappedBuffer(const_cast<char*>(toSerialize), count);
993 send(&wrappedBuffer);
1004 std::size_t elementCount, std::size_t
elementSize)
1024 throw std::logic_error(
"should not be called for blocking IO");
1029 throw std::logic_error(
"should not be called for blocking IO");
1035 if (_isOpen.getAndSet(
false))
1044 BreakTransport::shared_pointer B(
new BreakTransport);
1052 _sendThread.exitWait();
1053 _readThread.exitWait();
1090 Transport::shared_pointer thisSharedPtr = this->shared_from_this();
1091 _context->getTransportRegistry()->remove(thisSharedPtr);
1096 "TCP socket to %s is to be closed.",
1097 _socketName.c_str());
1107 return _isOpen.get();
1114 _readThread.start();
1116 _sendThread.start();
1121 void BlockingTCPTransportCodec::receiveThread()
1132 Transport::shared_pointer ptr(this->shared_from_this());
1143 }
catch (std::exception &e) {
1146 "an exception caught while in receiveThread at %s:%d: %s",
1147 __FILE__, __LINE__, e.what());
1150 "unknown exception caught while in receiveThread at %s:%d.",
1151 __FILE__, __LINE__);
1159 void BlockingTCPTransportCodec::sendThread()
1162 Transport::shared_pointer ptr(this->shared_from_this());
1173 }
catch (std::exception &e) {
1176 "an exception caught while in sendThread at %s:%d: %s",
1177 __FILE__, __LINE__, e.what());
1180 "unknown exception caught while in sendThread at %s:%d.",
1181 __FILE__, __LINE__);
1191 double timeout = !ena ? 0.0 :
std::max(0.0, _context->getConfiguration()->getPropertyAsDouble(
"EPICS_PVA_CONN_TMO", 30.0));
1193 DWORD timo = DWORD(timeout*1000);
1196 timo.tv_sec = unsigned(timeout);
1197 timo.tv_usec = (timeout-timo.tv_sec)*1e6;
1200 int ret = setsockopt(_channel, SOL_SOCKET, SO_RCVTIMEO, (
char*)&timo,
sizeof(timo));
1205 errlogPrintf(
"%s: Unable to set RX timeout: %d\n", _socketName.c_str(), err);
1227 SOCKET channel,
const ResponseHandler::shared_pointer &responseHandler,
1228 size_t sendBufferSize,
1229 size_t receiveBufferSize,
int16 priority)
1247 ,_context(context), _responseHandler(responseHandler)
1249 ,_priority(priority)
1263 "Error fetching socket remote address: %s.",
1282 std::size_t remaining;
1285 int bytesSent =
::send(_channel,
1304 if (bytesSent > 0) {
1318 std::size_t remaining;
1324 int bytesRead = ::recv(_channel,
1325 (
char*)(dst->
getBuffer()+pos), remaining, 0);
1389 AuthenticationSession::shared_pointer sess;
1395 sess->messageReceived(data);
1400 LOG(
logLevelWarn,
"authNZ message received from '%s' but no security plug-in session active.", ipAddrStr);
1418 control->
flush(
true);
1422 PVStructure::const_shared_pointer _data;
1435 Context::shared_pointer
const & context,
1437 ResponseHandler::shared_pointer
const & responseHandler,
1438 int32_t sendBufferSize,
1439 int32_t receiveBufferSize)
1442 ,_lastChannelSID(0x12003400)
1443 ,_verificationStatus(pvData::
Status::
fatal(
"Uninitialized error"))
1444 ,_verifyOrVerified(
false)
1462 while(_channels.find(sid)!=_channels.end())
1463 sid = ++_lastChannelSID;
1470 ServerChannel::shared_pointer
const & channel) {
1473 _channels[sid] = channel;
1481 _channels.erase(sid);
1485 ServerChannel::shared_pointer
1490 std::map<pvAccessID, ServerChannel::shared_pointer>::iterator it =
1491 _channels.find(sid);
1493 if(it!=_channels.end())
return it->second;
1495 return ServerChannel::shared_pointer();
1502 return _channels.size();
1508 for(_channels_t::const_iterator it(_channels.begin()), end(_channels.end());
1511 channels.push_back(it->second);
1518 if (!_verifyOrVerified)
1520 _verifyOrVerified =
true;
1552 std::vector<std::string> validSPNames;
1553 validSPNames.reserve(plugins.size());
1561 for(AuthenticationRegistry::list_t::iterator it(plugins.begin()), end(plugins.end());
1565 if(it->second->isValidFor(info))
1566 validSPNames.push_back(it->first);
1570 for (vector<string>::const_iterator iter(validSPNames.begin()), end(validSPNames.end());
1571 iter != end; iter++)
1578 advertisedAuthPlugins.swap(validSPNames);
1582 control->
flush(
true);
1594 sts = _verificationStatus;
1599 control->
flush(
true);
1606 if(_channels.size()==0)
return;
1612 "Transport to %s still has %zu channel(s) active and closing...",
1617 temp.swap(_channels);
1619 for(_channels_t::iterator it(temp.begin()), end(temp.end()); it!=end; ++it)
1620 it->second->destroy();
1624 Transport::shared_pointer thisSharedPtr = shared_from_this();
1630 const std::tr1::shared_ptr<PeerInfo>& peer)
1664 const epics::pvData::PVStructure::shared_pointer& data)
1671 throw std::runtime_error(
_socketName+
" failing attempt to select non-existant auth. plugin "+securityPluginName);
1673 PeerInfo::shared_pointer info(
new PeerInfo);
1675 info->transport =
"pva";
1677 info->authority = securityPluginName;
1679 if (!plugin->isValidFor(*info))
1687 AuthenticationSession::shared_pointer sess(plugin->createSession(info, shared_from_this(), data));
1699 Context::shared_pointer
const & context,
1701 ResponseHandler::shared_pointer
const & responseHandler,
1702 int32_t sendBufferSize,
1703 int32_t receiveBufferSize,
1704 ClientChannelImpl::shared_pointer
const &
client,
1706 float heartbeatInterval,
1707 int16_t priority ) :
1709 sendBufferSize, receiveBufferSize, priority),
1710 _connectionTimeout(heartbeatInterval),
1711 _verifyOrEcho(
true),
1725 double R = float(rand())/RAND_MAX;
1728 _context->getTimer()->schedulePeriodic(tcb, _connectionTimeout/2.0*R, _connectionTimeout/2.0);
1747 if(sendQueued)
return;
1755 #define EXCEPTION_GUARD(code) try { code; } \ 1756 catch (std::exception &e) { LOG(logLevelError, "Unhandled exception caught from code at %s:%d: %s", __FILE__, __LINE__, e.what()); } \ 1757 catch (...) { LOG(logLevelError, "Unhandled exception caught from code at %s:%d.", __FILE__, __LINE__); } 1768 _owners[client->getID()] = ClientChannelImpl::weak_pointer(client);
1786 size_t refs = _owners.size();
1793 "Transport to %s still has %zu client(s) active and closing...",
1797 TransportClientMap_t::iterator it = _owners.begin();
1798 for(; it!=_owners.end(); it++) {
1799 ClientChannelImpl::shared_pointer
client = it->second.
lock();
1821 _owners.erase(clientID);
1826 if(_owners.size()==0) {
1839 voe = _verifyOrEcho;
1840 _verifyOrEcho =
false;
1860 std::string pluginName;
1861 AuthenticationSession::shared_pointer session;
1887 control->
flush(
true);
1892 control->
flush(
true);
1901 std::string selectedName;
1902 AuthenticationPlugin::shared_pointer plugin;
1908 for(std::vector<std::string>::const_reverse_iterator it(offeredSecurityPlugins.rbegin()), end(offeredSecurityPlugins.rend());
1911 plugin = plugins.
lookup(*it);
1921 selectedName =
"anonymous";
1922 plugin = plugins.
lookup(selectedName);
1927 PeerInfo::shared_pointer info(
new PeerInfo);
1929 info->transport =
"pva";
1931 info->authority = selectedName;
1933 AuthenticationSession::shared_pointer sess(plugin->createSession(info, shared_from_this(), pvData::PVStructure::shared_pointer()));
1945 const std::tr1::shared_ptr<PeerInfo>& peer)
1952 AuthenticationSession::shared_pointer sess;
1958 sess->authenticationComplete(status);
virtual ~BlockingServerTCPTransportCodec() OVERRIDE FINAL
LIBCOM_API void epicsStdCall epicsSocketDestroy(SOCKET s)
void fatal(char *msg) NORETURN
epics::pvData::ByteBuffer _socketBuffer
static const std::size_t MAX_ENSURE_DATA_SIZE
#define EXCEPTION_GUARD(code)
#define SOCK_ECONNABORTED
virtual int read(epics::pvData::ByteBuffer *dst)=0
virtual void ensureData(std::size_t size) OVERRIDE FINAL
#define assert(exp)
Declare that a condition should be true.
size_t elementSize(ScalarType id)
gives sizeof(T) where T depends on the scalar type id.
static const std::size_t MAX_MESSAGE_PROCESS
Information provded by a client to a server-type ChannelProvider.
EPICS_ALWAYS_INLINE int8 getByte()
virtual bool directDeserialize(epics::pvData::ByteBuffer *, char *, std::size_t, std::size_t) OVERRIDE
virtual void processApplicationMessage()=0
virtual ~BlockingTCPTransportCodec()
static Status error(const std::string &m)
virtual void invalidDataStreamHandler()=0
virtual void sendBufferFull(int tries)=0
EPICS_ALWAYS_INLINE void putInt(int32 value)
const char * getBuffer() const
Class that must be implemented by code that makes Timer requests.
static void serializeFull(epics::pvData::ByteBuffer *buffer, epics::pvData::SerializableControl *control, const epics::pvData::PVField::const_shared_pointer &pvField)
virtual void waitJoin() OVERRIDE FINAL
Call after close() to wait for any worker threads to exit.
virtual bool terminated()=0
const epics::pvData::int8 PVA_MAGIC
virtual void send(epics::pvData::ByteBuffer *buffer, TransportSendControl *control) OVERRIDE FINAL
void run(const std::tr1::shared_ptr< PeerInfo > &peer)
virtual void flush(bool lastMessageCompleted) OVERRIDE FINAL
const epics::pvData::int8 PVA_CLIENT_PROTOCOL_REVISION
virtual void readPollOne() OVERRIDE FINAL
virtual void close() OVERRIDE FINAL
virtual void alignData(std::size_t alignment) OVERRIDE FINAL
std::string transport
transport protocol used eg. "pva". Must not be empty.
size_t getChannelCount() const
virtual ~BlockingClientTCPTransportCodec() OVERRIDE FINAL
std::size_t getLimit() const
pvAccessID preallocateChannelSID()
static void serializeNullField(epics::pvData::ByteBuffer *buffer, epics::pvData::SerializableControl *control)
pvd::StructureConstPtr type
virtual int write(epics::pvData::ByteBuffer *src) OVERRIDE FINAL
virtual void waitJoin()
Call after close() to wait for any worker threads to exit.
enum epicsSocketSystemCallInterruptMechanismQueryInfo epicsSocketSystemCallInterruptMechanismQuery()
virtual void endMessage() OVERRIDE FINAL
TODO only here because of the Lockable.
virtual void setRxTimeout(bool ena)
virtual void ensureBuffer(std::size_t size) OVERRIDE FINAL
epicsGuard< epicsMutex > Guard
virtual bool verify(epics::pvData::int32 timeoutMs) OVERRIDE
virtual void invalidDataStreamHandler() OVERRIDE FINAL
virtual void sendBufferFull(int tries) OVERRIDE FINAL
A lock for multithreading.
virtual void verified(epics::pvData::Status const &status) OVERRIDE FINAL
virtual void setRxTimeout(bool ena) OVERRIDE FINAL
#define PRINT_EXCEPTION(EI)
static void writeSize(std::size_t s, ByteBuffer *buffer, SerializableControl *flusher)
EPICS_ALWAYS_INLINE std::size_t getSize() const
bucket * lookup(char *name)
virtual void flushSerializeBuffer() OVERRIDE FINAL
virtual void internalClose() OVERRIDE FINAL
virtual void release(pvAccessID clientId) OVERRIDE FINAL
std::size_t getPosition() const
virtual void scheduleSend()=0
epics::pvData::Mutex _mutex
epicsSocketSystemCallInterruptMechanismQueryInfo
static std::size_t alignedValue(std::size_t value, std::size_t alignment)
const std::string & getMessage() const
virtual void writePollOne() OVERRIDE FINAL
virtual void flush(bool lastMessageCompleted)=0
BlockingTCPTransportCodec(bool serverFlag, Context::shared_pointer const &context, SOCKET channel, ResponseHandler::shared_pointer const &responseHandler, size_t sendBufferSize, size_t receiveBufferSize, epics::pvData::int16 priority)
void epicsSocketConvertErrnoToString(char *pBuf, unsigned bufSize)
EPICS_ALWAYS_INLINE int32 getInt()
virtual bool terminated() OVERRIDE FINAL
virtual void startMessage(epics::pvData::int8 command, std::size_t ensureCapacity=0, epics::pvData::int32 payloadSize=0) OVERRIDE FINAL
virtual void setByteOrder(int byteOrder) OVERRIDE FINAL
static const std::size_t MAX_MESSAGE_SEND
virtual void sendSecurityPluginMessage(epics::pvData::PVStructure::const_shared_pointer const &data) OVERRIDE FINAL
#define LOG(level, format,...)
static AuthenticationRegistry & servers()
The server side of the conversation.
void authNZInitialize(const std::string &securityPluginName, const epics::pvData::PVStructure::shared_pointer &data)
void setPosition(std::size_t pos)
std::string peer
network address of remote peer. eg. "192.168.1.1:5075".
AuthenticationSession::shared_pointer _authSession
virtual void internalClose() OVERRIDE FINAL
void send(ByteBuffer *buffer, TransportSendControl *control)
virtual void send(epics::pvData::ByteBuffer *buffer, TransportSendControl *control) OVERRIDE FINAL
void authNZInitialize(const std::vector< std::string > &offeredSecurityPlugins)
void serialize(ByteBuffer *buffer, SerializableControl *flusher) const
virtual bool isOpen() OVERRIDE FINAL
std::string _authSessionName
virtual void sendCompleted()=0
std::tr1::shared_ptr< ServerChannel > getChannel(pvAccessID sid)
void getChannels(std::vector< std::tr1::shared_ptr< ServerChannel > > &channels) const
epics::pvData::int8 getRevision() const
virtual bool isClosed() OVERRIDE FINAL
std::tr1::shared_ptr< TimerCallback > TimerCallbackPtr
void snapshot(list_t &plugmap) const
Save a copy of the current registry in order of increasing priority.
epicsThreadId _senderThread
SecurityPluginMessageTransportSender(PVStructure::const_shared_pointer const &data)
static const std::size_t MAX_ENSURE_SIZE
const std::string & getStackDump() const
const epics::pvData::int16 PVA_MESSAGE_HEADER_SIZE
AuthenticationPlugin::shared_pointer lookup(const std::string &name) const
virtual void verified(epics::pvData::Status const &status) OVERRIDE FINAL
EPICS_ALWAYS_INLINE void putByte(int8 value)
This class implements a Bytebuffer that is like the java.nio.ByteBuffer.
BSD and SRV5 Unix timestamp.
void unregisterChannel(pvAccessID sid)
virtual int read(epics::pvData::ByteBuffer *dst) OVERRIDE FINAL
virtual void internalClose()
static const char * StatusTypeName[]
BlockingServerTCPTransportCodec(Context::shared_pointer const &context, SOCKET channel, ResponseHandler::shared_pointer const &responseHandler, int32_t sendBufferSize, int32_t receiveBufferSize)
static void serializeString(const std::string &value, ByteBuffer *buffer, SerializableControl *flusher)
std::size_t getRemaining() const
virtual void authenticationCompleted(epics::pvData::Status const &status, const std::tr1::shared_ptr< PeerInfo > &peer) OVERRIDE FINAL
void destroyAllChannels()
int errlogPrintf(const char *pFormat,...)
const epics::pvData::int8 PVA_SERVER_PROTOCOL_REVISION
Context::shared_pointer _context
virtual epics::pvData::int16 getPriority() const OVERRIDE FINAL
osiSockAddr _socketAddress
epics::pvData::Event _verifiedEvent
#define epicsThreadPriorityCAServerLow
virtual std::size_t getReceiveBufferSize() const OVERRIDE FINAL
virtual void callback() OVERRIDE FINAL
virtual void readPollOne()=0
virtual int write(epics::pvData::ByteBuffer *src)=0
virtual void authenticationCompleted(epics::pvData::Status const &status, const std::tr1::shared_ptr< PeerInfo > &peer) OVERRIDE FINAL
virtual void start() OVERRIDE FINAL
virtual void processControlMessage()=0
void setEndianess(int byteOrder)
LIBCOM_API void epicsStdCall epicsThreadSleep(double seconds)
Block the calling thread for at least the specified time.
PeerInfo::const_shared_pointer _peerInfo
fair_queue< TransportSender > _sendQueue
C++ wrapper for epicsThread from EPICS base.
epics::pvData::ByteBuffer _sendBuffer
void registerChannel(pvAccessID sid, std::tr1::shared_ptr< ServerChannel > const &channel)
shared_ptr< T > dynamic_pointer_cast(shared_ptr< U > const &r) BOOST_NOEXCEPT
static AuthorizationRegistry & plugins()
static AuthenticationRegistry & clients()
The client side of the conversation.
std::vector< map_t::mapped_type > list_t
const epics::pvData::int8 _clientServerFlag
const epics::pvData::int16 PVA_DEFAULT_PRIORITY
EPICS time-stamps (epicsTimeStamp), epicsTime C++ class and C functions for handling wall-clock times...
virtual bool acquire(std::tr1::shared_ptr< ClientChannelImpl > const &client) OVERRIDE FINAL
virtual bool directSerialize(epics::pvData::ByteBuffer *, const char *, std::size_t, std::size_t) OVERRIDE
std::string authority
authentication mechanism used. eg. "anonymous" or "gssapi". Must not be empty.
static size_t num_instances
C++ and C descriptions for a thread.
void send(epics::pvData::ByteBuffer *buffer)
const epics::pvData::int32 MAX_TCP_RECV
virtual void startMessage(epics::pvData::int8 command, std::size_t ensureCapacity, epics::pvData::int32 payloadSize=0)=0
virtual void alignBuffer(std::size_t alignment) OVERRIDE FINAL
unsigned transportVersion
If applicable, the protocol minor version number.
virtual const osiSockAddr * getLastReadBufferSocketAddress()=0
virtual void enqueueSendRequest(TransportSender::shared_pointer const &sender) OVERRIDE FINAL
StatusType getType() const
void setLimit(std::size_t limit)
string inetAddressToString(const osiSockAddr &addr, bool displayPort, bool displayHex)
bool getAndSet(bool newval)
BlockingClientTCPTransportCodec(Context::shared_pointer const &context, SOCKET channel, ResponseHandler::shared_pointer const &responseHandler, int32_t sendBufferSize, int32_t receiveBufferSize, std::tr1::shared_ptr< ClientChannelImpl > const &client, epics::pvData::int8 remoteTransportRevision, float heartbeatInterval, int16_t priority)
EPICS_ALWAYS_INLINE void putShort(int16 value)
static size_t num_instances
void putControlMessage(epics::pvData::int8 command, epics::pvData::int32 data)
virtual void setRecipient(osiSockAddr const &sendTo) OVERRIDE FINAL
virtual void authNZMessage(epics::pvData::PVStructure::shared_pointer const &data) OVERRIDE FINAL
#define IS_LOGGABLE(level)
virtual void verified(epics::pvData::Status const &status) OVERRIDE
POINTER_DEFINITIONS(BlockingTCPTransportCodec)
unsigned epicsStdCall ipAddrToDottedIP(const struct sockaddr_in *paddr, char *pBuf, unsigned bufSize)
LIBCOM_API epicsThreadId epicsStdCall epicsThreadGetIdSelf(void)