summaryrefslogtreecommitdiffstats
path: root/net/Socket.cpp
diff options
context:
space:
mode:
authorTor Lillqvist <tml@iki.fi>2018-09-04 12:02:20 +0300
committerTor Lillqvist <tml@collabora.com>2018-09-04 12:24:48 +0300
commit997503a8d17178bb6eaab50e796f1be1dc84bbab (patch)
tree8f0e2f9e922edc08913709caa8a708355219678c /net/Socket.cpp
parentMake this file compile for iOS (diff)
downloadonline-997503a8d17178bb6eaab50e796f1be1dc84bbab.tar.gz
online-997503a8d17178bb6eaab50e796f1be1dc84bbab.zip
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
Diffstat (limited to 'net/Socket.cpp')
-rw-r--r--net/Socket.cpp15
1 files changed, 14 insertions, 1 deletions
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 <SigUtil.hpp>
#include "Socket.hpp"
+#ifdef __linux
#include "ServerSocket.hpp"
#include "SslSocket.hpp"
+#endif
#include "WebSocketHandler.hpp"
int SocketPoll::DefaultPollTimeoutMs = 5000;
std::atomic<bool> SocketPoll::InhibitThreadChecks(false);
std::atomic<bool> 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<accept>\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,