From 997503a8d17178bb6eaab50e796f1be1dc84bbab Mon Sep 17 00:00:00 2001 From: Tor Lillqvist Date: Tue, 4 Sep 2018 12:02:20 +0300 Subject: Make this file compile for iOS Again, note that I don't claim this file (or the code-base as such) would make much sense for iOS as such at the moment. I just want it to compile for now. Baby steps etc. (And there is no public Xcode project to compile it even partially.) Change-Id: I1321d61e9e911c7d97c7309b78aab46d9cecec29 --- net/Socket.cpp | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'net/Socket.cpp') diff --git a/net/Socket.cpp b/net/Socket.cpp index 2fc2a14253..98bb6b996d 100644 --- a/net/Socket.cpp +++ b/net/Socket.cpp @@ -24,14 +24,18 @@ #include #include "Socket.hpp" +#ifdef __linux #include "ServerSocket.hpp" #include "SslSocket.hpp" +#endif #include "WebSocketHandler.hpp" int SocketPoll::DefaultPollTimeoutMs = 5000; std::atomic SocketPoll::InhibitThreadChecks(false); std::atomic Socket::InhibitThreadChecks(false); +#ifdef __linux + int Socket::createSocket(Socket::Type type) { int domain = type == Type::IPv4 ? AF_INET : AF_INET6; @@ -216,12 +220,15 @@ void SocketPoll::insertNewWebSocketSync(const Poco::URI &uri, const std::shared_ LOG_ERR("Failed to lookup client websocket host '" << uri.getHost() << "' skipping"); } +#endif + +#ifdef __linux + void ServerSocket::dumpState(std::ostream& os) { os << "\t" << getFD() << "\t\n"; } - void SocketDisposition::execute() { // We should have hard ownership of this socket. @@ -238,6 +245,8 @@ void SocketDisposition::execute() const int WebSocketHandler::InitialPingDelayMs = 25; const int WebSocketHandler::PingFrequencyMs = 18 * 1000; +#endif + void WebSocketHandler::dumpState(std::ostream& os) { os << (_shuttingDown ? "shutd " : "alive ") @@ -272,6 +281,8 @@ void StreamSocket::send(Poco::Net::HTTPResponse& response) send(oss.str()); } +#ifdef __linux + void SocketPoll::dumpState(std::ostream& os) { // FIXME: NOT thread-safe! _pollSockets is modified from the polling thread! @@ -333,6 +344,8 @@ bool ServerSocket::bind(Type type, int port) return rc == 0; } +#endif + bool StreamSocket::parseHeader(const char *clientName, Poco::MemoryInputStream &message, Poco::Net::HTTPRequest &request, -- cgit