removed WHY_SA macro
first of all, its stupid. second thing - sa? seriously?
This commit is contained in:
parent
0994558a39
commit
ee1c784b84
@ -26,7 +26,6 @@ extern "C" {
|
|||||||
#include <why2/flags.h>
|
#include <why2/flags.h>
|
||||||
|
|
||||||
//MACROS
|
//MACROS
|
||||||
#define WHY2_SA struct sockaddr
|
|
||||||
#define WHY2_CHAT_SERVER_PORT 1204 //PORT FOR SERVER
|
#define WHY2_CHAT_SERVER_PORT 1204 //PORT FOR SERVER
|
||||||
#define WHY2_CHAT_AUTHORITY_PORT 1203 //PORT FOR CA
|
#define WHY2_CHAT_AUTHORITY_PORT 1203 //PORT FOR CA
|
||||||
#define WHY2_MAX_CONNECTIONS 1000 //MAX USERS CONNECTED AT ONE TIME
|
#define WHY2_MAX_CONNECTIONS 1000 //MAX USERS CONNECTED AT ONE TIME
|
||||||
|
@ -148,7 +148,7 @@ int main(void)
|
|||||||
|
|
||||||
free(line); //PREVENT FROM MEMORY LEAK
|
free(line); //PREVENT FROM MEMORY LEAK
|
||||||
|
|
||||||
int connectStatus = connect(listen_socket, (WHY2_SA *) &server_addr, sizeof(server_addr)); //CONNECT
|
int connectStatus = connect(listen_socket, (struct sockaddr *) &server_addr, sizeof(server_addr)); //CONNECT
|
||||||
|
|
||||||
if (connectStatus < 0) why2_die("Connecting failed.");
|
if (connectStatus < 0) why2_die("Connecting failed.");
|
||||||
|
|
||||||
|
@ -51,7 +51,7 @@ int main(void)
|
|||||||
server_addr.sin_addr.s_addr = INADDR_ANY;
|
server_addr.sin_addr.s_addr = INADDR_ANY;
|
||||||
|
|
||||||
//BIND SOCKET
|
//BIND SOCKET
|
||||||
if (bind(listen_socket, (WHY2_SA *) &server_addr, sizeof(server_addr)) < 0) why2_die("Failed binding socket.");
|
if (bind(listen_socket, (struct sockaddr *) &server_addr, sizeof(server_addr)) < 0) why2_die("Failed binding socket.");
|
||||||
|
|
||||||
//LISTEN
|
//LISTEN
|
||||||
if (listen(listen_socket, WHY2_MAX_CONNECTIONS) < 0) why2_die("Binding failed.");
|
if (listen(listen_socket, WHY2_MAX_CONNECTIONS) < 0) why2_die("Binding failed.");
|
||||||
|
@ -873,7 +873,7 @@ void *why2_accept_thread(void *socket)
|
|||||||
//LOOP ACCEPT
|
//LOOP ACCEPT
|
||||||
for (;;)
|
for (;;)
|
||||||
{
|
{
|
||||||
accepted = accept(*((int*) socket), (WHY2_SA *) NULL, NULL); //ACCEPT NEW SOCKET
|
accepted = accept(*((int*) socket), (struct sockaddr *) NULL, NULL); //ACCEPT NEW SOCKET
|
||||||
|
|
||||||
if (accepted == -1) continue;
|
if (accepted == -1) continue;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user