summaryrefslogtreecommitdiffstats
path: root/source/OSSupport/Socket.h
diff options
context:
space:
mode:
authormadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2013-03-04 19:40:48 +0100
committermadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2013-03-04 19:40:48 +0100
commiteb68b7ce0157fd55b7d50cca956986d0fdb60bd1 (patch)
treec0aa246374d5dcb034b4652ea937fc0a5478c67b /source/OSSupport/Socket.h
parentPlayer can sit in minecarts (but not move them yet) (diff)
downloadcuberite-eb68b7ce0157fd55b7d50cca956986d0fdb60bd1.tar
cuberite-eb68b7ce0157fd55b7d50cca956986d0fdb60bd1.tar.gz
cuberite-eb68b7ce0157fd55b7d50cca956986d0fdb60bd1.tar.bz2
cuberite-eb68b7ce0157fd55b7d50cca956986d0fdb60bd1.tar.lz
cuberite-eb68b7ce0157fd55b7d50cca956986d0fdb60bd1.tar.xz
cuberite-eb68b7ce0157fd55b7d50cca956986d0fdb60bd1.tar.zst
cuberite-eb68b7ce0157fd55b7d50cca956986d0fdb60bd1.zip
Diffstat (limited to 'source/OSSupport/Socket.h')
-rw-r--r--source/OSSupport/Socket.h14
1 files changed, 13 insertions, 1 deletions
diff --git a/source/OSSupport/Socket.h b/source/OSSupport/Socket.h
index 43a80dca5..71ec99fad 100644
--- a/source/OSSupport/Socket.h
+++ b/source/OSSupport/Socket.h
@@ -62,8 +62,20 @@ public:
static const short ADDRESS_FAMILY_INTERNET = 2;
static const unsigned long INTERNET_ADDRESS_ANY = 0;
static unsigned long INTERNET_ADDRESS_LOCALHOST(void); // 127.0.0.1 represented in network byteorder; must be a function due to GCC :(
+ static const unsigned short ANY_PORT = 0; // When given to Bind() functions, they will find a free port
- int Bind( SockAddr_In& a_Address );
+ /// Binds to the specified port on "any" interface (0.0.0.0)
+ int BindToAny(unsigned short a_Port);
+
+ /*
+ // TODO:
+ /// Binds to the specified port
+ int BindToAny6(unsigned short a_Port);
+ */
+
+ /// Binds to the specified port on localhost interface (127.0.0.1) through IPv4
+ int BindToLocalhost(unsigned short a_Port);
+
int Listen( int a_Backlog );
cSocket Accept();
int Connect(SockAddr_In & a_Address); // Returns 0 on success, !0 on failure