summaryrefslogtreecommitdiffstats
path: root/source/cSocket.h
diff options
context:
space:
mode:
authormadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2012-02-07 08:44:00 +0100
committermadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2012-02-07 08:44:00 +0100
commit5750fbf65f1a27af80afb3e68353f3dc91d48bfc (patch)
tree4b51752c10242d7c07e75f6f077dc698636c6d7a /source/cSocket.h
parentcSocket: error reporting function now works correctly on GNU Linux; also includes the error number for all errors (diff)
downloadcuberite-5750fbf65f1a27af80afb3e68353f3dc91d48bfc.tar
cuberite-5750fbf65f1a27af80afb3e68353f3dc91d48bfc.tar.gz
cuberite-5750fbf65f1a27af80afb3e68353f3dc91d48bfc.tar.bz2
cuberite-5750fbf65f1a27af80afb3e68353f3dc91d48bfc.tar.lz
cuberite-5750fbf65f1a27af80afb3e68353f3dc91d48bfc.tar.xz
cuberite-5750fbf65f1a27af80afb3e68353f3dc91d48bfc.tar.zst
cuberite-5750fbf65f1a27af80afb3e68353f3dc91d48bfc.zip
Diffstat (limited to '')
-rw-r--r--source/cSocket.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/source/cSocket.h b/source/cSocket.h
index 81408c918..8098714c4 100644
--- a/source/cSocket.h
+++ b/source/cSocket.h
@@ -6,6 +6,7 @@
class cSocket
{
+public:
#ifdef _WIN32
typedef SOCKET xSocket;
#else
@@ -13,7 +14,6 @@ class cSocket
static const int INVALID_SOCKET = -1;
#endif
-public:
cSocket(void) : m_Socket(INVALID_SOCKET) {}
cSocket(xSocket a_Socket);
~cSocket();
@@ -55,11 +55,16 @@ public:
static const short ADDRESS_FAMILY_INTERNET = 2;
static const unsigned long INTERNET_ADDRESS_ANY = 0;
+ static unsigned long INTERNET_ADDRESS_LOCALHOST; // 127.0.0.1 represented in network byteorder
int Bind( SockAddr_In& a_Address );
int Listen( int a_Backlog );
cSocket Accept();
+ int Connect(SockAddr_In & a_Address); // Returns 0 on success, !0 on failure
int Receive( char* a_Buffer, unsigned int a_Length, unsigned int a_Flags );
+ int Send (const char * a_Buffer, unsigned int a_Length);
+
+ unsigned short GetPort(void) const; // Returns 0 on failure
const AString & GetIPString(void) const { return m_IPString; }