listen on 0.0.0.0 by default
This commit is contained in:
@@ -78,6 +78,10 @@ setupClient()
|
|||||||
// create a message buffer
|
// create a message buffer
|
||||||
char msg[1024];
|
char msg[1024];
|
||||||
// setup a socket and connection tools
|
// setup a socket and connection tools
|
||||||
|
|
||||||
|
if (IP_ADDRESS == "0.0.0.0")
|
||||||
|
IP_ADDRESS = "127.0.0.1";
|
||||||
|
|
||||||
struct hostent *host = gethostbyname(IP_ADDRESS.c_str());
|
struct hostent *host = gethostbyname(IP_ADDRESS.c_str());
|
||||||
sockaddr_in sendSockAddr;
|
sockaddr_in sendSockAddr;
|
||||||
bzero((char *)&sendSockAddr, sizeof(sendSockAddr));
|
bzero((char *)&sendSockAddr, sizeof(sendSockAddr));
|
||||||
|
|||||||
2
main.cc
2
main.cc
@@ -24,7 +24,7 @@
|
|||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
const int PORT_NUM = 8888;
|
const int PORT_NUM = 8888;
|
||||||
string IP_ADDRESS = "127.0.0.1";
|
string IP_ADDRESS = "0.0.0.0";
|
||||||
const int DEFAULT_CUR_X = 2; // the x position of the preferred default cursor
|
const int DEFAULT_CUR_X = 2; // the x position of the preferred default cursor
|
||||||
// position for message entry
|
// position for message entry
|
||||||
const int DEFAULT_CUR_Y = 12; // the x position of the preferred default cursor
|
const int DEFAULT_CUR_Y = 12; // the x position of the preferred default cursor
|
||||||
|
|||||||
Reference in New Issue
Block a user