zenilib
0.5.3.0
|
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include "SDL.h"
#include "SDL_net.h"
#include "chat.h"
Go to the source code of this file.
Functions | |
static void | cleanup (int exitcode) |
void | HandleClient (int which) |
void | HandleServer (void) |
main (int argc, char *argv[]) | |
void | SendNew (int about, int to) |
Variables | |
struct { | |
int active | |
Uint8 name [256+1] | |
IPaddress peer | |
TCPsocket sock | |
} | people [CHAT_MAXPEOPLE] |
static TCPsocket | servsock = NULL |
static SDLNet_SocketSet | socketset = NULL |
Definition at line 178 of file chatd.c.
References NULL, SDL_Quit(), SDLNet_FreeSocketSet(), SDLNet_Quit(), SDLNet_TCP_Close(), servsock, and socketset.
Definition at line 116 of file chatd.c.
References active, CHAT_DEL, CHAT_DEL_LEN, CHAT_DEL_SLOT, CHAT_HELLO, CHAT_HELLO_NAME, CHAT_HELLO_PORT, CHAT_MAXPEOPLE, i, memcpy, NULL, peer, people, IPaddress::port, SDLNet_TCP_Close(), SDLNet_TCP_DelSocket(), SDLNet_TCP_Recv(), SDLNet_TCP_Send(), SendNew(), sock, and socketset.
Definition at line 47 of file chatd.c.
References active, CHAT_BYE, CHAT_MAXPEOPLE, NULL, people, SDLNet_TCP_Accept(), SDLNet_TCP_AddSocket(), SDLNet_TCP_Close(), SDLNet_TCP_DelSocket(), SDLNet_TCP_GetPeerAddress(), SDLNet_TCP_Send(), servsock, sock, and socketset.
main | ( | int | argc, |
char * | argv[] | ||
) |
Definition at line 193 of file chatd.c.
References CHAT_MAXPEOPLE, CHAT_PORT, cleanup(), HandleClient(), HandleServer(), IPaddress::host, i, NULL, people, IPaddress::port, SDL_GetError(), SDL_Init(), SDL_Quit(), SDLNet_AllocSocketSet(), SDLNet_CheckSockets(), SDLNet_GetError(), SDLNet_Init(), SDLNet_ResolveHost(), SDLNet_SocketReady, SDLNet_TCP_AddSocket(), SDLNet_TCP_Open(), servsock, sock, and socketset.
Definition at line 101 of file chatd.c.
References CHAT_ADD, CHAT_ADD_HOST, CHAT_ADD_NAME, CHAT_ADD_NLEN, CHAT_ADD_PORT, CHAT_ADD_SLOT, IPaddress::host, memcpy, peer, people, IPaddress::port, SDLNet_TCP_Send(), and sock.
Referenced by HandleClient().
IPaddress peer |
Definition at line 42 of file chatd.c.
Referenced by HandleClient(), and SendNew().
struct { ... } people[CHAT_MAXPEOPLE] |
Referenced by HandleClient(), HandleServer(), main(), and SendNew().
Definition at line 37 of file chatd.c.
Referenced by cleanup(), HandleServer(), and main().
TCPsocket sock |
Definition at line 41 of file chatd.c.
Referenced by HandleClient(), HandleServer(), main(), SDLNet_GetLocalAddresses(), SDLNet_TCP_Accept(), SDLNet_TCP_Open(), SDLNet_UDP_Open(), and SendNew().
|
static |
Definition at line 38 of file chatd.c.
Referenced by cleanup(), HandleClient(), HandleServer(), and main().