</projects>
<buildSpec>
<buildCommand>
+ <name>org.python.pydev.PyDevBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
<name>org.eclipse.cdt.managedbuilder.core.genmakebuilder</name>
<triggers>clean,full,incremental,</triggers>
<arguments>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.buildArguments</key>
- <value></value>
+ <value>scons -j2</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.buildCommand</key>
- <value>make</value>
+ <value>nice</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.cleanBuildTarget</key>
- <value>clean</value>
+ <value>-c</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.contents</key>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.fullBuildTarget</key>
- <value>build</value>
+ <value>default</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.stopOnError</key>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.useDefaultBuildCmd</key>
- <value>true</value>
+ <value>false</value>
</dictionary>
</arguments>
</buildCommand>
<nature>org.eclipse.cdt.managedbuilder.core.managedBuildNature</nature>
<nature>org.eclipse.cdt.core.cnature</nature>
<nature>org.eclipse.cdt.core.ccnature</nature>
+ <nature>org.python.pydev.pythonNature</nature>
</natures>
</projectDescription>
CPPDEFINES = [ '$expandLogOption', '$CPPDEFINES_' ],
expandLogOption = senfutil.expandLogOption,
CPPDEFINES_ = senfutil.BuildTypeOptions('CPPDEFINES'),
- CPPDEFINES_final = [ ],
+ CPPDEFINES_final = [ 'SENF_PPI_NOTRACE'],
CPPDEFINES_normal = [ 'SENF_DEBUG' ],
CPPDEFINES_debug = [ '$CPPDEFINES_normal' ],
prefix_ void senf::ppi::connector::Connector::trace(Packet const & p, char const * label)
{
- if (traceState_ == NO_TRACING)
+ if (traceState_ == NO_TRACING)
return;
SENF_LOG_BLOCK(({
std::string type (prettyName(p.typeId().id()));
ConsoleRegister::ConsoleRegister()
{
+#ifndef SENF_PPI_NOTRACE
senf::ppi::ModuleManager::instance().consoleDir()
.add("tracing", senf::console::factory::Command(
SENF_FNP(senf::ppi::connector::Connector::TraceState,
(senf::ppi::connector::Connector::TraceState)))
.arg("state", "new tracing state")
);
+#endif
}
ConsoleRegister consoleRegister;
if (!nativeThrottled_)
emitUnthrottle();
} else
- throttleTrace("OUT", "not forwarding unthrottle event");
+ SENF_PPI_THROTTLE_TRACE("OUT", "not forwarding unthrottle event");
}
///////////////////////////////////////////////////////////////////////////
prefix_ void senf::ppi::connector::ActiveConnector::notifyThrottle()
{
- throttleTrace("IN ", "throttle");
+ SENF_PPI_THROTTLE_TRACE("IN ", "throttle");
if (! throttled_) {
throttled_ = true;
if (throttleCallback_)
prefix_ void senf::ppi::connector::ActiveConnector::notifyUnthrottle()
{
- throttleTrace("IN ", "unthrottle");
+ SENF_PPI_THROTTLE_TRACE("IN ", "unthrottle");
if (throttled_) {
throttled_ = false;
if (unthrottleCallback_)
queue_.pop_back();
v_dequeueEvent();
}
- trace(p, "IN ");
+ SENF_PPI_TRACE(p, "IN ");
return p;
}
#define prefix_ inline
///////////////////////////////cci.p///////////////////////////////////////
+#ifdef SENF_PPI_NOTRACE
+# define SENF_PPI_THROTTLE_TRACE(label, type)
+# define SENF_PPI_TRACE(packet, label)
+#else
+# define SENF_PPI_THROTTLE_TRACE(label, type) throttleTrace(label, type)
+# define SENF_PPI_TRACE(packet, label) trace(packet, label)
+#endif
+
///////////////////////////////////////////////////////////////////////////
// senf::ppi::connector::Connector
prefix_ void senf::ppi::connector::PassiveConnector::emitThrottle()
{
- throttleTrace("OUT", "throttle");
+ SENF_PPI_THROTTLE_TRACE("OUT", "throttle");
if (connected())
peer().notifyThrottle();
}
prefix_ void senf::ppi::connector::PassiveConnector::emitUnthrottle()
{
- throttleTrace("OUT", "unthrottle");
+ SENF_PPI_THROTTLE_TRACE("OUT", "unthrottle");
if (connected()) {
peer().notifyUnthrottle();
v_unthrottleEvent();
{
// No event callback has been registered (onRequest() call missing)
SENF_ASSERT(callback_, "senf::ppi::connector::PassiveConnector: missing onRequest()");
- if (!throttled())
+ if (!throttled()) {
callback_();
- else
- throttleTrace("IN ", "queueing packet");
+ } else {
+ SENF_PPI_THROTTLE_TRACE("IN ", "queueing packet");
+ }
}
///////////////////////////////////////////////////////////////////////////
prefix_ void senf::ppi::connector::OutputConnector::operator()(Packet const & p)
{
- trace(p, "OUT");
+ SENF_PPI_TRACE(p, "OUT");
if (connected())
peer().enqueue(p);
}
// senf::ppi::module::PassiveQueueingSocketSink<Writer>
template <class Writer>
-prefix_ senf::ppi::module::PassiveQueueingSocketSink<Writer>::PassiveQueueingSocketSink(Handle handle, QueueingAlgorithm::ptr qAlgorithm)
+prefix_ senf::ppi::module::PassiveQueueingSocketSink<Writer>::PassiveQueueingSocketSink(Handle const & handle, QueueingAlgorithm::ptr qAlgorithm)
: dir( this),
handle_( handle), writer_( ),
qAlgo_( qAlgorithm),
// indent-tabs-mode: nil
// ispell-local-dictionary: "american"
// compile-command: "scons -u test"
-// End:
+// End::
}
template <class Writer>
-prefix_ void senf::ppi::module::PassiveQueueingSocketSink<Writer>::handle(Handle handle)
+prefix_ void senf::ppi::module::PassiveQueueingSocketSink<Writer>::handle(Handle const & handle)
{
handle_ = handle;
event_.set( handle_, IOEvent::Write);
connector::PassiveInput<PacketType> input; ///< Input connector from which data is received
console::ScopedDirectory<PassiveQueueingSocketSink<Writer> > dir;
- explicit PassiveQueueingSocketSink(Handle handle, QueueingAlgorithm::ptr qAlgorithm);
+ explicit PassiveQueueingSocketSink(Handle const & handle, QueueingAlgorithm::ptr qAlgorithm);
Writer & writer(); ///< Access the Writer
Handle & handle(); ///< Access handle
- void handle(Handle handle); ///< Set handle
+ void handle(Handle const & handle);
+ ///< Set handle
/**< Assigning an empty or in-valid() handle will disable
the module until a new valid handle is assigned. */
QueueingAlgorithm & qAlgorithm();
protocolId_ = dest.port();
}
-prefix_ bool senf::ppi::IPv4SourceForcingDgramWriter::operator()(Handle handle,
+prefix_ bool senf::ppi::IPv4SourceForcingDgramWriter::operator()(Handle & handle,
Packet const & packet)
{
return sendtoandfrom(
protocolId_ = dest.port();
}
-prefix_ bool senf::ppi::IPv6SourceForcingDgramWriter::operator()(Handle handle,
+prefix_ bool senf::ppi::IPv6SourceForcingDgramWriter::operator()(Handle & handle,
Packet const & packet)
{
return sendtoandfrom(
///////////////////////////////////////////////////////////////////////////
// senf::ppi::ConnectedDgramWriter
-prefix_ bool senf::ppi::ConnectedDgramWriter::operator()(Handle handle,
+prefix_ bool senf::ppi::ConnectedDgramWriter::operator()(Handle & handle,
Packet const & packet)
{
return handle.write(packet.data()) != packet.data().begin();
}
template <class Writer>
-prefix_ senf::ppi::module::ActiveSocketSink<Writer>::ActiveSocketSink(Handle handle)
+prefix_ senf::ppi::module::ActiveSocketSink<Writer>::ActiveSocketSink(Handle const & handle)
: handle_(handle), event_(handle_, IOEvent::Write), writer_()
{
registerEvent( event_, &ActiveSocketSink::write );
}
template <class Writer>
-prefix_ senf::ppi::module::ActiveSocketSink<Writer>::ActiveSocketSink(Handle handle,
+prefix_ senf::ppi::module::ActiveSocketSink<Writer>::ActiveSocketSink(Handle const & handle,
Writer const & writer)
: handle_(handle), event_(handle_, IOEvent::Write), writer_(writer)
{
}
template <class Writer>
-prefix_ senf::ppi::module::PassiveSocketSink<Writer>::PassiveSocketSink(Handle handle)
+prefix_ senf::ppi::module::PassiveSocketSink<Writer>::PassiveSocketSink(Handle const & handle)
: handle_(handle), writer_()
{
noroute(input);
}
template <class Writer>
-prefix_ senf::ppi::module::PassiveSocketSink<Writer>::PassiveSocketSink(Handle handle,
+prefix_ senf::ppi::module::PassiveSocketSink<Writer>::PassiveSocketSink(Handle const & handle,
Writer const & writer)
: handle_(handle), writer_(writer)
{
}
template <class HandleType>
-prefix_ bool senf::ppi::TargetDgramWriter<HandleType>::operator()(Handle handle,
+prefix_ bool senf::ppi::TargetDgramWriter<HandleType>::operator()(Handle & handle,
Packet const & packet)
{
if (target_)
}
template <class Writer>
-prefix_ void senf::ppi::module::ActiveSocketSink<Writer>::handle(Handle handle)
+prefix_ void senf::ppi::module::ActiveSocketSink<Writer>::handle(Handle const & handle)
{
handle_ = handle;
event_.set(handle_, IOEvent::Write);
}
template <class Writer>
-prefix_ void senf::ppi::module::PassiveSocketSink<Writer>::handle(Handle handle)
+prefix_ void senf::ppi::module::PassiveSocketSink<Writer>::handle(Handle const & handle)
{
handle_ = handle;
checkThrottle();
///< Handle type supported by this writer
typedef Packet PacketType;
- bool operator()(Handle handle, Packet const & packet);
+ bool operator()(Handle & handle, Packet const & packet);
///< Write \a packet to \a handle
/**< Write the complete \a packet as a datagram to \a
handle.
typename Handle::Address target() const; ///< Get current target address
void target(typename Handle::Address const & target); ///< Set target address
- bool operator()(Handle handle, Packet const & packet); ///< Write \a packet to \a handle
+ bool operator()(Handle & handle, Packet const & packet); ///< Write \a packet to \a handle
/**< Write the complete \a packet as a datagram to \a
handle.
\param[in] handle Handle to write data to
void destination(senf::INet4SocketAddress & dest);
senf::INet4SocketAddress destination();
- bool operator()(Handle handle, Packet const & packet);
+ bool operator()(Handle & handle, Packet const & packet);
///< Write \a packet to \a handle
/**< Write the complete \a packet as a datagram to \a
handle.
void destination(senf::INet6SocketAddress & dest);
senf::INet6SocketAddress destination();
- bool operator()(Handle handle, Packet const & packet);
+ bool operator()(Handle & handle, Packet const & packet);
///< Write \a packet to \a handle
/**< Write the complete \a packet as a datagram to \a
handle.
\pre Requires \a Writer to be copy constructible
\param[in] writer Writer helper writing packet date to
the socket */
- explicit ActiveSocketSink(Handle handle); ///< Create new writer for the given handle
+ explicit ActiveSocketSink(Handle const & handle);
+ ///< Create new writer for the given handle
/**< Data will be written to \a handle using \a Writer.
\pre Requires \a Writer to be default constructible
\param[in] handle Handle to write data to */
- ActiveSocketSink(Handle handle, Writer const & writer);
+ ActiveSocketSink(Handle const & handle, Writer const & writer);
///< Create new writer for the given handle
/**< Data will be written to \a handle using \a Writer.
\pre Requires \a Writer to be copy constructible
Writer & writer(); ///< Access the Writer
Handle handle(); ///< Access handle
- void handle(Handle handle); ///< Set handle
+ void handle(Handle const & handle);
+ ///< Set handle
/**< Assigning an empty or in-valid() handle will disable
the module until a new. valid handle is assigned. */
\pre Requires \a Writer to be copy constructible
\param[in] writer Writer helper writing packet date to
the socket */
- explicit PassiveSocketSink(Handle handle); ///< Create new writer for the given handle
+ explicit PassiveSocketSink(Handle const & handle);
+ ///< Create new writer for the given handle
/**< Data will be written to \a handle using \a Writer.
\pre Requires \a Writer to be default constructible
\param[in] handle Handle to write data to */
- PassiveSocketSink(Handle handle, Writer const & writer);
+ PassiveSocketSink(Handle const & handle, Writer const & writer);
///< Create new writer for the given handle
/**< Data will be written to \a handle using \a Writer.
\pre Requires \a Writer to be copy constructible
Writer & writer(); ///< Access the Writer
Handle & handle(); ///< Access handle
- void handle(Handle handle); ///< Set handle
+ void handle(Handle const & handle);
+ ///< Set handle
/**< Assigning an empty or in-valid() handle will disable
the module until a new valid handle is assigned. */
// senf::ppi::DgramReader<Packet,MaxSize>
template <class Packet, unsigned MaxSize>
-prefix_ Packet senf::ppi::DgramReader<Packet,MaxSize>::operator()(Handle handle)
+prefix_ Packet senf::ppi::DgramReader<Packet,MaxSize>::operator()(Handle & handle)
{
Packet packet (Packet::create(senf::noinit));
handle.read(packet.data(), MaxSize);
}
template <class Reader>
-prefix_ senf::ppi::module::ActiveSocketSource<Reader>::ActiveSocketSource(Handle handle)
+prefix_ senf::ppi::module::ActiveSocketSource<Reader>::ActiveSocketSource(Handle const & handle)
: handle_(handle), event_(handle_, IOEvent::Read)
{
registerEvent( event_, &ActiveSocketSource::read );
}
template <class Reader>
-prefix_ senf::ppi::module::ActiveSocketSource<Reader>::ActiveSocketSource(Handle handle,
+prefix_ senf::ppi::module::ActiveSocketSource<Reader>::ActiveSocketSource(Handle const & handle,
Reader reader)
: handle_(handle), event_(handle_, IOEvent::Read), reader_(reader)
{
}
template <class Reader>
-prefix_ senf::ppi::module::ActiveBurstSocketSource<Reader>::ActiveBurstSocketSource(Handle handle, unsigned max_burst)
+prefix_ senf::ppi::module::ActiveBurstSocketSource<Reader>::ActiveBurstSocketSource(Handle const & handle, unsigned max_burst)
: handle_(handle), event_(handle_, IOEvent::Read), maxBurst_(max_burst)
{
registerEvent( event_, &ActiveBurstSocketSource::read );
}
template <class Reader>
-prefix_ senf::ppi::module::ActiveBurstSocketSource<Reader>::ActiveBurstSocketSource(Handle handle,
+prefix_ senf::ppi::module::ActiveBurstSocketSource<Reader>::ActiveBurstSocketSource(Handle const & handle,
Reader reader, unsigned max_burst)
: handle_(handle), event_(handle_, IOEvent::Read), reader_(reader), maxBurst_(max_burst)
{
}
template <class Reader>
-prefix_ void senf::ppi::module::ActiveSocketSource<Reader>::handle(Handle handle)
+prefix_ void senf::ppi::module::ActiveSocketSource<Reader>::handle(Handle const & handle)
{
handle_ = handle;
event_.set(handle_, IOEvent::Read);
}
template <class Reader>
-prefix_ void senf::ppi::module::ActiveBurstSocketSource<Reader>::handle(Handle handle)
+prefix_ void senf::ppi::module::ActiveBurstSocketSource<Reader>::handle(Handle const & handle)
{
handle_ = handle;
event_.set(handle_, IOEvent::Read);
senf::DatagramFramingPolicy >::policy > Handle;
///< Handle type supported by this reader
- Packet operator()(Handle handle);
+ Packet operator()(Handle & handle);
///< Read packet from \a handle
/**< Read a datagram from \a handle and interpret is as
packet of type \c Packet.
explicit ActiveSocketSource(Reader reader); ///< Create non-connected reader
/**< The reader will be disabled until a socket is set
\pre Requires \a Reader to be copy constructible */
- explicit ActiveSocketSource(Handle handle); ///< Create new reader for the given handle
+ explicit ActiveSocketSource(Handle const & handle);
+ ///< Create new reader for the given handle
/**< Data will be read from \a handle and be parsed by \a
Reader.
\pre Requires \a Reader to be default constructible
\param[in] handle Handle to read data from */
- ActiveSocketSource(Handle handle, Reader reader);
+ ActiveSocketSource(Handle const & handle, Reader reader);
///< Create new reader for the given handle
/**< Data will be read from \a handle and be parsed by \a
Reader.
Reader & reader(); ///< Access Reader helper
Handle handle(); ///< Access handle
- void handle(Handle handle); ///< Set handle
+ void handle(Handle const & handle);
+ ///< Set handle
/**< Assigning an empty or in-valid() handle will disable
the module until a new, valid handle is assigned. */
private:
ActiveBurstSocketSource(unsigned max_burst);
explicit ActiveBurstSocketSource(Reader reader, unsigned max_burst);
- explicit ActiveBurstSocketSource(Handle handle, unsigned max_burst);
- ActiveBurstSocketSource(Handle handle, Reader reader, unsigned max_burst);
+ explicit ActiveBurstSocketSource(Handle const & handle, unsigned max_burst);
+ ActiveBurstSocketSource(Handle const & handle, Reader reader, unsigned max_burst);
Reader & reader(); ///< Access Reader helper
Handle handle(); ///< Access handle
- void handle(Handle handle); ///< Set handle
+ void handle(Handle const & handle);
+ ///< Set handle
/**< Assigning an empty or in-valid() handle will disable
the module until a new, valid handle is assigned. */
#define prefix_
///////////////////////////////cc.p////////////////////////////////////////
-prefix_ void senf::ConnectedCommunicationPolicy::do_listen(FileHandle handle,
+prefix_ void senf::ConnectedCommunicationPolicy::do_listen(FileHandle const & handle,
unsigned backlog)
{
::listen(handle.fd(),backlog);
}
-prefix_ int senf::ConnectedCommunicationPolicy::do_accept(FileHandle handle,
+prefix_ int senf::ConnectedCommunicationPolicy::do_accept(FileHandle const & handle,
struct sockaddr * addr,
unsigned len)
{
#define prefix_ inline
///////////////////////////////cci.p///////////////////////////////////////
-prefix_ int senf::ConnectedCommunicationPolicy::accept(FileHandle handle)
+prefix_ int senf::ConnectedCommunicationPolicy::accept(FileHandle const & handle)
{
return do_accept(handle, 0, 0);
}
#ifndef DOXYGEN
template <class SPolicy>
prefix_ void senf::ConnectedCommunicationPolicy::
-listen(ServerSocketHandle<SPolicy> handle, unsigned backlog,
+listen(ServerSocketHandle<SPolicy> const & handle, unsigned backlog,
typename IfAddressingPolicyIsNot<SPolicy,NoAddressingPolicy>::type *)
{
do_listen(handle, backlog);
#else
template <class SPolicy>
prefix_ void senf::ConnectedCommunicationPolicy::
-listen(ServerSocketHandle<SPolicy> handle, unsigned backlog)
+listen(ServerSocketHandle<SPolicy> const & handle, unsigned backlog)
{}
#endif
#ifndef DOXYGEN
template <class SPolicy>
prefix_ int senf::ConnectedCommunicationPolicy::
-accept(ServerSocketHandle<SPolicy> handle,
+accept(ServerSocketHandle<SPolicy> const & handle,
typename ServerSocketHandle<SPolicy>::Address & address,
typename IfAddressingPolicyIsNot<SPolicy,NoAddressingPolicy>::type *)
{
#else
template <class SPolicy>
prefix_ int senf::ConnectedCommunicationPolicy::
-accept(ServerSocketHandle<SPolicy> handle,
+accept(ServerSocketHandle<SPolicy> const & handle,
typename ServerSocketHandle<SPolicy>::Address & address)
{}
#endif
{
# ifndef DOXYGEN
template <class SPolicy>
- static void listen(ServerSocketHandle<SPolicy> handle, unsigned backlog,
+ static void listen(ServerSocketHandle<SPolicy> const & handle, unsigned backlog,
typename IfAddressingPolicyIsNot<SPolicy,NoAddressingPolicy>::type * = 0);
# else
template <class SPolicy>
- static void listen(ServerSocketHandle<SPolicy> handle, unsigned backlog);
+ static void listen(ServerSocketHandle<SPolicy> const & handle, unsigned backlog);
///< Enable establishing new connections on the socket
/**< \param[in] handle socket handle to enable reception on
\param[in] backlog size of backlog queue */
# ifndef DOXYGEN
template <class SPolicy>
- static int accept(ServerSocketHandle<SPolicy> handle,
+ static int accept(ServerSocketHandle<SPolicy> const & handle,
typename ServerSocketHandle<SPolicy>::Address & address,
typename IfAddressingPolicyIsNot<SPolicy,NoAddressingPolicy>::type * = 0);
# else
template <class SPolicy>
- static int accept(ServerSocketHandle<SPolicy> handle,
+ static int accept(ServerSocketHandle<SPolicy> const & handle,
typename ServerSocketHandle<SPolicy>::Address & address);
///< accept a new connection on the socket.
/**< The accept() member will return a new client file
\returns file descriptor of new client socket */
# endif
- static int accept(FileHandle handle);
+ static int accept(FileHandle const & handle);
///< accept a new connection on the socket.
/**< The accept() member will return a new client file
descriptor. This file descriptor will be used by the
\returns file descriptor of new client socket */
private:
- static void do_listen(FileHandle handle, unsigned backlog);
- static int do_accept(FileHandle handle, struct sockaddr * addr, unsigned len);
+ static void do_listen(FileHandle const & handle, unsigned backlog);
+ static int do_accept(FileHandle const & handle, struct sockaddr * addr, unsigned len);
};
/** \brief CommunicationPolicy for unconnected sockets
#define prefix_
///////////////////////////////cc.p////////////////////////////////////////
-prefix_ void senf::BSDAddressingPolicyMixinBase::do_local(FileHandle handle,
+prefix_ void senf::BSDAddressingPolicyMixinBase::do_local(FileHandle const & handle,
struct sockaddr * addr,
socklen_t * len)
{
SENF_THROW_SYSTEM_EXCEPTION("");
}
-prefix_ void senf::BSDAddressingPolicyMixinBase::do_peer(FileHandle handle,
+prefix_ void senf::BSDAddressingPolicyMixinBase::do_peer(FileHandle const & handle,
struct sockaddr * addr,
socklen_t * len)
{
SENF_THROW_SYSTEM_EXCEPTION("");
}
-prefix_ void senf::BSDAddressingPolicyMixinBase::do_bind(FileHandle handle,
+prefix_ void senf::BSDAddressingPolicyMixinBase::do_bind(FileHandle const & handle,
struct sockaddr const * addr,
socklen_t len)
{
SENF_THROW_SYSTEM_EXCEPTION("");
}
-prefix_ void senf::BSDAddressingPolicyMixinBase::do_connect(FileHandle handle,
+prefix_ void senf::BSDAddressingPolicyMixinBase::do_connect(FileHandle const & handle,
struct sockaddr const * addr,
socklen_t len)
{
template <class Address>
template <class SPolicy>
prefix_ void senf::BSDAddressingPolicyMixin<Address>::
-peer(SocketHandle<SPolicy> handle, Address & addr,
+peer(SocketHandle<SPolicy> const & handle, Address & addr,
typename IfCommunicationPolicyIs<SPolicy,ConnectedCommunicationPolicy>::type *)
{
try {
template <class Address>
template <class SPolicy>
prefix_ void senf::BSDAddressingPolicyMixin<Address>::
-peer(SocketHandle<SPolicy> handle, Address & addr)
+peer(SocketHandle<SPolicy> const & handle, Address & addr)
{}
#endif
template <class Address>
template <class SPolicy>
prefix_ void senf::BSDAddressingPolicyMixin<Address>::
-connect(SocketHandle<SPolicy> handle, Address const & addr,
+connect(SocketHandle<SPolicy> const & handle, Address const & addr,
typename IfCommunicationPolicyIs<SPolicy,ConnectedCommunicationPolicy>::type *)
{
try {
template <class Address>
template <class SPolicy>
prefix_ void senf::BSDAddressingPolicyMixin<Address>::
-connect(SocketHandle<SPolicy> handle, Address const & addr)
+connect(SocketHandle<SPolicy> const & handle, Address const & addr)
{}
#endif
template <class Address>
-prefix_ void senf::BSDAddressingPolicyMixin<Address>::local(FileHandle handle,
+prefix_ void senf::BSDAddressingPolicyMixin<Address>::local(FileHandle const & handle,
Address & addr)
{
try {
}
template <class Address>
-prefix_ void senf::BSDAddressingPolicyMixin<Address>::bind(FileHandle handle,
+prefix_ void senf::BSDAddressingPolicyMixin<Address>::bind(FileHandle const & handle,
Address const & addr)
{
try {
*/
struct BSDAddressingPolicyMixinBase
{
- static void do_local(FileHandle handle, struct sockaddr * addr, socklen_t * len);
- static void do_peer(FileHandle handle, struct sockaddr * addr, socklen_t * len);
- static void do_bind(FileHandle handle, struct sockaddr const * addr, socklen_t len);
- static void do_connect(FileHandle handle, struct sockaddr const * addr, socklen_t len);
+ static void do_local(FileHandle const & handle, struct sockaddr * addr, socklen_t * len);
+ static void do_peer(FileHandle const & handle, struct sockaddr * addr, socklen_t * len);
+ static void do_bind(FileHandle const & handle, struct sockaddr const * addr, socklen_t len);
+ static void do_connect(FileHandle const & handle, struct sockaddr const * addr, socklen_t len);
};
/** \brief Template for generic AddressingPolicy implementation based on the BSD socket API
{
# ifndef DOXYGEN
template <class SPolicy>
- static void peer(SocketHandle<SPolicy> handle, Address & addr,
+ static void peer(SocketHandle<SPolicy> const & handle, Address & addr,
typename IfCommunicationPolicyIs<SPolicy,ConnectedCommunicationPolicy>::type * = 0);
# else
template <class SPolicy>
- static void peer(SocketHandle<SPolicy> handle, Address & addr);
+ static void peer(SocketHandle<SPolicy> const & handle, Address & addr);
///< Return address of remote peer on connected sockets
/**< This member is only available if the socket handles
communication policy is ConnectedCommunicationPolicy.
\param[in] handle socket handle to get peer address of
\param[out] addr address of remote peer */
# endif
- static void local(FileHandle handle, Address & addr);
+ static void local(FileHandle const & handle, Address & addr);
///< Return local of socket
/**< \param[in] handle socket handle to check
\param[out] addr local socket address */
# ifndef DOXYGEN
template <class SPolicy>
- static void connect(SocketHandle<SPolicy> handle, Address const & addr,
+ static void connect(SocketHandle<SPolicy> const & handle, Address const & addr,
typename IfCommunicationPolicyIs<SPolicy,ConnectedCommunicationPolicy>::type * = 0);
# else
template <class SPolicy>
- static void connect(SocketHandle<SPolicy> handle, Address const & addr);
+ static void connect(SocketHandle<SPolicy> const & handle, Address const & addr);
///< Connect to remote host
/**< This member is only available if the socket handles
communication policy is ConnectedCommunicationPolicy.
\param[in] addr address of remote peer to connect
to */
# endif
- static void bind(FileHandle handle, Address const & addr);
+ static void bind(FileHandle const & handle, Address const & addr);
///< Set local socket address
/**< \param[in] handle socket handle
\param[in] addr local socket address */
#define prefix_
///////////////////////////////cc.p////////////////////////////////////////
-prefix_ unsigned senf::ReadablePolicy::read(FileHandle handle, char * buffer,
+prefix_ unsigned senf::ReadablePolicy::read(FileHandle & handle, char * buffer,
unsigned size)
{
int rv = -1;
return rv;
}
-prefix_ unsigned senf::ReadablePolicy::do_readfrom(FileHandle handle, char * buffer,
+prefix_ unsigned senf::ReadablePolicy::do_readfrom(FileHandle & handle, char * buffer,
unsigned size,
struct ::sockaddr * addr, socklen_t * len)
{
return rv;
}
-prefix_ unsigned senf::WriteablePolicy::do_write(FileHandle handle, char const * buffer,
+prefix_ unsigned senf::WriteablePolicy::do_write(FileHandle & handle, char const * buffer,
unsigned size)
{
int rv = -1;
return rv;
}
-prefix_ unsigned senf::WriteablePolicy::do_writeto(FileHandle handle,
+prefix_ unsigned senf::WriteablePolicy::do_writeto(FileHandle & handle,
char const * buffer, unsigned size,
struct sockaddr const * addr, socklen_t len)
{
#ifndef DOXYGEN
template <class SPolicy>
prefix_ unsigned senf::ReadablePolicy::
-readfrom(ClientSocketHandle<SPolicy> handle, char * buffer, unsigned size,
+readfrom(ClientSocketHandle<SPolicy> & handle, char * buffer, unsigned size,
typename SPolicy::AddressingPolicy::Address & address,
typename IfCommunicationPolicyIs<SPolicy,UnconnectedCommunicationPolicy>::type *)
{
#else
template <class SPolicy>
prefix_ unsigned senf::ReadablePolicy::
-readfrom(ClientSocketHandle<SPolicy> handle, char * buffer, unsigned size,
+readfrom(ClientSocketHandle<SPolicy> & handle, char * buffer, unsigned size,
typename Policy::AddressingPolicy::Address & address)
{}
#endif
#ifndef DOXYGEN
template <class SPolicy>
prefix_ unsigned senf::WriteablePolicy::
-write(ClientSocketHandle<SPolicy> handle, char const * buffer, unsigned size,
+write(ClientSocketHandle<SPolicy> & handle, char const * buffer, unsigned size,
typename IfCommunicationPolicyIs<SPolicy,ConnectedCommunicationPolicy>::type *)
{
return do_write(handle,buffer,size);
#else
template <class SPolicy>
prefix_ unsigned senf::WriteablePolicy::
-write(ClientSocketHandle<SPolicy> handle, char const * buffer, unsigned size)
+write(ClientSocketHandle<SPolicy> & handle, char const * buffer, unsigned size)
{}
#endif
#ifndef DOXYGEN
template <class SPolicy>
prefix_ unsigned senf::WriteablePolicy::
-writeto(ClientSocketHandle<SPolicy> handle,
+writeto(ClientSocketHandle<SPolicy> & handle,
typename boost::call_traits<typename SPolicy::AddressingPolicy::Address>::param_type addr,
char const * buffer, unsigned size,
typename IfCommunicationPolicyIs<SPolicy,UnconnectedCommunicationPolicy>::type *)
#else
template <class SPolicy>
prefix_ unsigned senf::WriteablePolicy::
-writeto(ClientSocketHandle<SPolicy> handle,
+writeto(ClientSocketHandle<SPolicy> & handle,
typename Policy::AddressingPolicy::Address const & addr,
char const * buffer, unsigned size)
{}
*/
struct ReadablePolicy : public ReadPolicyBase
{
- static unsigned read(FileHandle handle, char * buffer, unsigned size);
+ static unsigned read(FileHandle & handle, char * buffer, unsigned size);
///< read data from socket
/**< \param[in] handle socket handle to read from
\param[in] buffer address of buffer to write data to
\returns number of bytes read */
# ifndef DOXYGEN
template <class SPolicy>
- static unsigned readfrom(ClientSocketHandle<SPolicy> handle, char * buffer, unsigned size,
+ static unsigned readfrom(ClientSocketHandle<SPolicy> & handle, char * buffer, unsigned size,
typename SPolicy::AddressingPolicy::Address & address,
typename IfCommunicationPolicyIs<
SPolicy,UnconnectedCommunicationPolicy>::type * = 0);
# else
template <class SPolicy>
- static unsigned readfrom(ClientSocketHandle<SPolicy> handle, char * buffer, unsigned size,
+ static unsigned readfrom(ClientSocketHandle<SPolicy> & handle, char * buffer, unsigned size,
typename Policy::AddressingPolicy::Address & address);
///< read data from socket returning peer address
/**< \param[in] handle socket handle to read from
# endif
private:
- static unsigned do_readfrom(FileHandle handle, char * buffer, unsigned size,
+ static unsigned do_readfrom(FileHandle & handle, char * buffer, unsigned size,
struct ::sockaddr * addr, socklen_t * len);
};
{
# ifndef DOXYGEN
template <class SPolicy>
- static unsigned write(ClientSocketHandle<SPolicy> handle, char const * buffer, unsigned size,
+ static unsigned write(ClientSocketHandle<SPolicy> & handle, char const * buffer, unsigned size,
typename IfCommunicationPolicyIs<
SPolicy,ConnectedCommunicationPolicy>::type * = 0);
# else
template <class SPolicy>
- static unsigned write(ClientSocketHandle<SPolicy> handle, char const * buffer,
+ static unsigned write(ClientSocketHandle<SPolicy> & handle, char const * buffer,
unsigned size);
///< write data to socket
/**< This member is only enabled if the socket uses
# endif
# ifndef DOXYGEN
template <class SPolicy>
- static unsigned writeto(ClientSocketHandle<SPolicy> handle,
+ static unsigned writeto(ClientSocketHandle<SPolicy> & handle,
typename boost::call_traits<
typename SPolicy::AddressingPolicy::Address>::param_type addr,
char const * buffer, unsigned size,
SPolicy,UnconnectedCommunicationPolicy>::type * = 0);
# else
template <class SPolicy>
- static unsigned writeto(ClientSocketHandle<SPolicy> handle,
+ static unsigned writeto(ClientSocketHandle<SPolicy> & handle,
typename Policy::AddressingPolicy::Address const & addr,
char const * buffer, unsigned size);
///< write data to socket sending to given peer
# endif
private:
- static unsigned do_write(FileHandle handle, char const * buffer, unsigned size);
- static unsigned do_writeto(FileHandle handle, char const * buffer, unsigned size,
+ static unsigned do_write(FileHandle & handle, char const * buffer, unsigned size);
+ static unsigned do_writeto(FileHandle & handle, char const * buffer, unsigned size,
struct sockaddr const * addr, socklen_t len);
};