Port as integer
This commit is contained in:
parent
248f442c33
commit
8f7d748606
3 changed files with 7 additions and 2 deletions
|
@ -8,7 +8,6 @@
|
|||
#include <winsock.h>
|
||||
|
||||
#define IP INADDR_ANY
|
||||
#define PORT 8888
|
||||
|
||||
enum NET_COMMANDS {
|
||||
CONNECT,
|
||||
|
@ -31,6 +30,8 @@ struct packet {
|
|||
} touch;
|
||||
};
|
||||
|
||||
extern int port;
|
||||
|
||||
extern SOCKET listener;
|
||||
extern SOCKET client;
|
||||
|
||||
|
|
|
@ -39,6 +39,8 @@ int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrevInst, LPSTR lpCmd, int nShow)
|
|||
|
||||
initNetwork();
|
||||
|
||||
printf("Port: %d\n", port);
|
||||
|
||||
printf("Running on: %s\n", hostName);
|
||||
|
||||
printf("Your local IP(s):\n");
|
||||
|
|
|
@ -2,6 +2,8 @@
|
|||
|
||||
#include "wireless.h"
|
||||
|
||||
int port = 8888;
|
||||
|
||||
SOCKET listener;
|
||||
SOCKET client;
|
||||
|
||||
|
@ -53,7 +55,7 @@ void startListening(void) {
|
|||
|
||||
serverInfo.sin_family = AF_INET;
|
||||
serverInfo.sin_addr.s_addr = IP;
|
||||
serverInfo.sin_port = htons(PORT);
|
||||
serverInfo.sin_port = htons(port);
|
||||
|
||||
u_long one = 1;
|
||||
ioctlsocket(listener, FIONBIO, &one);
|
||||
|
|
Loading…
Reference in a new issue