summaryrefslogtreecommitdiffhomepage
path: root/NetEx/NetSock.cpp
diff options
context:
space:
mode:
authorAki <please@ignore.pl>2022-01-30 17:41:24 +0100
committerAki <please@ignore.pl>2022-01-30 17:41:24 +0100
commit51657e10769faa2617d546a06c42e4c62a19bb50 (patch)
tree688ad8b61ac02e50974684b9b7d3f886fb469e5f /NetEx/NetSock.cpp
parentdb987e23d5dd33a5db8764743facbb906ac22b0f (diff)
downloadstarshatter-51657e10769faa2617d546a06c42e4c62a19bb50.zip
starshatter-51657e10769faa2617d546a06c42e4c62a19bb50.tar.gz
starshatter-51657e10769faa2617d546a06c42e4c62a19bb50.tar.bz2
Removed trailing whitespace all over the place
Diffstat (limited to 'NetEx/NetSock.cpp')
-rw-r--r--NetEx/NetSock.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/NetEx/NetSock.cpp b/NetEx/NetSock.cpp
index 0fb1081..06cbdcc 100644
--- a/NetEx/NetSock.cpp
+++ b/NetEx/NetSock.cpp
@@ -122,7 +122,7 @@ NetSock::accept(NetAddr* addr)
if (addr) {
sockaddr a;
int asize = sizeof(a);
-
+
conn = ::accept(s, &a, &asize);
if (conn != INVALID_SOCKET && asize > 0) {
@@ -140,19 +140,19 @@ NetSock::accept(NetAddr* addr)
}
// +--------------------------------------------------------------------+
-
+
int
NetSock::available()
{
if (closed || s == INVALID_SOCKET) return 0;
-
+
DWORD nbytes = 0;
if (::ioctlsocket(s, FIONREAD, &nbytes) == 0)
return (int) nbytes;
return 0;
}
-
+
// +--------------------------------------------------------------------+
int
@@ -279,7 +279,7 @@ NetSock::set_timeout(int msecs)
{
if (closed || s == INVALID_SOCKET) return 0;
if (msecs == current_timeout) return 1;
-
+
// zero timeout means non-blocking
if (msecs == 0) {
u_long nonblocking = 1;
@@ -288,7 +288,7 @@ NetSock::set_timeout(int msecs)
return stat;
}
}
-
+
// non-zero timeout means blocking
else {
if (current_timeout == 0) {
@@ -305,14 +305,14 @@ NetSock::set_timeout(int msecs)
::setsockopt(s, SOL_SOCKET, SO_RCVTIMEO, (char*) &maxto, sizeof(maxto));
::setsockopt(s, SOL_SOCKET, SO_SNDTIMEO, (char*) &maxto, sizeof(maxto));
}
-
+
// otherwise, set the timeout
else {
::setsockopt(s, SOL_SOCKET, SO_RCVTIMEO, (char*) &msecs, sizeof(msecs));
::setsockopt(s, SOL_SOCKET, SO_SNDTIMEO, (char*) &msecs, sizeof(msecs));
}
}
-
+
current_timeout = msecs;
return 1;
}