5 #include <Poco/Mutex.h>
6 #include <Poco/Semaphore.h>
7 #include <Poco/SharedPtr.h>
8 #include <Poco/Timespan.h>
10 #include <Poco/Net/IPAddress.h>
11 #include <Poco/Net/Socket.h>
12 #include <Poco/Net/SocketAddress.h>
13 #include <Poco/Net/SocketStream.h>
15 #include "io/Console.h"
16 #include "ssl/SSLServer.h"
17 #include "util/Loggable.h"
31 typedef Poco::SharedPtr<TCPConsoleSessionImpl> Ptr;
36 std::string
readUntil(
const char c)
override;
37 std::string
readBytes(
const unsigned int length)
override;
38 void print(
const std::string &text,
bool newline =
true)
override;
42 Poco::Net::Socket m_socket;
43 Poco::Net::SocketAddress m_peerAddress;
44 Poco::Net::SocketInputStream m_input;
45 Poco::Net::SocketOutputStream m_output;
60 DEFAULT_TIMEOUT_MS = 500,
63 void setAddress(
const std::string &address);
64 void setPort(
int port);
65 void setSendTimeout(
const Poco::Timespan &timeout);
66 void setRecvTimeout(
const Poco::Timespan &timeout);
67 void setPollTimeout(
const Poco::Timespan &timeout);
68 void setBacklog(
int backlog);
69 void setSSLConfig(SSLServer::Ptr config);
72 void close()
override;
75 ConsoleSessionImpl::Ptr openSession()
override;
76 void startListenUnlocked();
79 Poco::Net::IPAddress m_address;
81 Poco::Timespan m_sendTimeout;
82 Poco::Timespan m_recvTimeout;
83 Poco::Timespan m_pollTimeout;
84 unsigned int m_backlog;
85 Poco::SharedPtr<Poco::Net::ServerSocket> m_serverSocket;
86 SSLServer::Ptr m_sslConfig;
87 Poco::FastMutex m_lock;
88 Poco::AtomicCounter m_close;
Definition: TCPConsole.h:29
std::string readBytes(const unsigned int length) override
Definition: TCPConsole.cpp:59
Definition: TCPConsole.h:52
bool eof() override
Definition: TCPConsole.cpp:69
std::string readUntil(const char c) override
Definition: TCPConsole.cpp:54
Definition: Loggable.h:19
Definition: Console.h:109
void print(const std::string &text, bool newline=true) override
Definition: TCPConsole.cpp:64