summaryrefslogtreecommitdiffstats
path: root/source/cSocket.cpp
diff options
context:
space:
mode:
authormadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2012-02-07 22:16:03 +0100
committermadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2012-02-07 22:16:03 +0100
commit21f758c9c05137f1f3e27d4363ca7c272ee7907c (patch)
treef6e6ea19d05d2c9ab5f2bd72e1fe298680779a2c /source/cSocket.cpp
parentTemporary fix for Linux compilation. (gcc won't accept a function call in global var initialization) (diff)
downloadcuberite-21f758c9c05137f1f3e27d4363ca7c272ee7907c.tar
cuberite-21f758c9c05137f1f3e27d4363ca7c272ee7907c.tar.gz
cuberite-21f758c9c05137f1f3e27d4363ca7c272ee7907c.tar.bz2
cuberite-21f758c9c05137f1f3e27d4363ca7c272ee7907c.tar.lz
cuberite-21f758c9c05137f1f3e27d4363ca7c272ee7907c.tar.xz
cuberite-21f758c9c05137f1f3e27d4363ca7c272ee7907c.tar.zst
cuberite-21f758c9c05137f1f3e27d4363ca7c272ee7907c.zip
Diffstat (limited to 'source/cSocket.cpp')
-rw-r--r--source/cSocket.cpp20
1 files changed, 14 insertions, 6 deletions
diff --git a/source/cSocket.cpp b/source/cSocket.cpp
index f53724216..42cc298a7 100644
--- a/source/cSocket.cpp
+++ b/source/cSocket.cpp
@@ -16,12 +16,6 @@
- unsigned long cSocket::INTERNET_ADDRESS_LOCALHOST = 127; // TODO: Linux won't accept this: htonl((127 << 24) | 1);
-
-
-
-
-
cSocket::cSocket(xSocket a_Socket)
: m_Socket(a_Socket)
{
@@ -195,6 +189,20 @@ cSocket cSocket::CreateSocket()
+unsigned long cSocket::INTERNET_ADDRESS_LOCALHOST(void)
+{
+ static unsigned long LocalHost = 0;
+ if (LocalHost == 0)
+ {
+ LocalHost = inet_addr("127.0.0.1"); // GCC won't accept this as a global var assignment
+ }
+ return LocalHost;
+}
+
+
+
+
+
int cSocket::Bind(SockAddr_In& a_Address)
{
sockaddr_in local;