#include "Server.ih"
// Custom includes
-#include <unistd.h>
#include <iostream>
#include <boost/algorithm/string/trim.hpp>
#include <boost/iostreams/device/file_descriptor.hpp>
reader_->enablePrompt();
}
+prefix_ std::ostream & senf::console::operator<<(std::ostream & os, Client const & client)
+{
+ // typedef senf::ClientSocketHandle<MakeSocketPolicy<INet4AddressingPolicy>::policy > v4Socket;
+ if( senf::check_socket_cast<TCPv4ServerSocketHandle::ClientSocketHandle>( client.handle())) {
+ os<<senf::dynamic_socket_cast<TCPv4ServerSocketHandle::ClientSocketHandle>( client.handle()).peer();
+ }
+ else if( senf::check_socket_cast<TCPv6ServerSocketHandle::ClientSocketHandle>( client.handle())) {
+ os<<senf::dynamic_socket_cast<TCPv6ServerSocketHandle::ClientSocketHandle>( client.handle()).peer();
+ }
+ else{
+ os<<((void *)&client);
+ }
+ return os;
+}
+prefix_ std::ostream & senf::console::operator<<(std::ostream & os, Client * client)
+{
+ return os<<*client;
+}
///////////////////////////////cc.e////////////////////////////////////////
#undef prefix_
//#include "Server.mpp"
friend class detail::ClientReader;
friend class detail::NonblockingSocketSink;
};
+
+ /** \brief Output INet4Address instance as it's string representation
+ \related INet4Address
+ */
+ std::ostream & operator<<(std::ostream & os, Client const & client);
+ std::ostream & operator<<(std::ostream & os, Client * client);
}}
TestObject test;
testDir
- .add("testob", test.dir)
+ .add("extra", test.dir)
.doc("Example of an instance directory");
senf::console::Server::start( senf::INet4SocketAddress(23232u) )