summaryrefslogtreecommitdiffstats
path: root/net/Socket.cpp
diff options
context:
space:
mode:
authorJan Holesovsky <kendy@collabora.com>2019-02-12 12:16:40 +0100
committerJan Holesovsky <kendy@collabora.com>2019-02-12 12:20:11 +0100
commitf76b36193df424e9718bb25c589c6efd476774cc (patch)
tree48bb6f13ab7d9f5158da81f91ffe5c5712314e93 /net/Socket.cpp
parentandroid: Define MOBILEAPP via config.h. (diff)
downloadonline-f76b36193df424e9718bb25c589c6efd476774cc.tar.gz
online-f76b36193df424e9718bb25c589c6efd476774cc.zip
android: #if(n)def MOBILEAPP -> #if (!)MOBILEAPP for better reliability.
Change-Id: I5f9c9420b6c83601db1c8fdba4ae5a10b17b2107
Diffstat (limited to 'net/Socket.cpp')
-rw-r--r--net/Socket.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/net/Socket.cpp b/net/Socket.cpp
index 2d35f6b02f..8d2cd3533c 100644
--- a/net/Socket.cpp
+++ b/net/Socket.cpp
@@ -28,7 +28,7 @@
#include <SigUtil.hpp>
#include "ServerSocket.hpp"
-#ifndef MOBILEAPP
+#if !MOBILEAPP
#include "SslSocket.hpp"
#endif
#include "WebSocketHandler.hpp"
@@ -39,7 +39,7 @@ std::atomic<bool> Socket::InhibitThreadChecks(false);
int Socket::createSocket(Socket::Type type)
{
-#ifndef MOBILEAPP
+#if !MOBILEAPP
int domain = type == Type::IPv4 ? AF_INET : AF_INET6;
return socket(domain, SOCK_STREAM | SOCK_NONBLOCK, 0);
#else
@@ -71,7 +71,7 @@ SocketPoll::SocketPoll(const std::string& threadName)
{
// Create the wakeup fd.
if (
-#ifndef MOBILEAPP
+#if !MOBILEAPP
::pipe2(_wakeup, O_CLOEXEC | O_NONBLOCK) == -1
#else
fakeSocketPipe2(_wakeup) == -1
@@ -99,7 +99,7 @@ SocketPoll::~SocketPoll()
getWakeupsArray().erase(it);
}
-#ifndef MOBILEAPP
+#if !MOBILEAPP
::close(_wakeup[0]);
::close(_wakeup[1]);
#else
@@ -190,14 +190,14 @@ void SocketPoll::wakeupWorld()
}
void SocketPoll::insertNewWebSocketSync(
-#ifndef MOBILEAPP
+#if !MOBILEAPP
const Poco::URI &uri,
#else
int peerSocket,
#endif
const std::shared_ptr<SocketHandlerInterface>& websocketHandler)
{
-#ifndef MOBILEAPP
+#if !MOBILEAPP
LOG_INF("Connecting to " << uri.getHost() << " : " << uri.getPort() << " : " << uri.getPath());
// FIXME: put this in a ClientSocket class ?
@@ -380,7 +380,7 @@ void SocketPoll::dumpState(std::ostream& os)
/// Returns true on success only.
bool ServerSocket::bind(Type type, int port)
{
-#ifndef MOBILEAPP
+#if !MOBILEAPP
// Enable address reuse to avoid stalling after
// recycling, when previous socket is TIME_WAIT.
//TODO: Might be worth refactoring out.
@@ -430,7 +430,7 @@ bool ServerSocket::bind(Type type, int port)
#endif
}
-#ifndef MOBILEAPP
+#if !MOBILEAPP
bool StreamSocket::parseHeader(const char *clientName,
Poco::MemoryInputStream &message,