Google
Web alhem.net
Main Page | Alphabetical List | Class List | File List | Class Members | File Members

chat.cpp File Reference

#include <stdio.h>
#include <signal.h>
#include <ListenSocket.h>
#include "ChatHandler.h"
#include "ChatSocket.h"

Include dependency graph for chat.cpp:

Include dependency graph

Go to the source code of this file.

Defines

#define DEB(x)

Functions

void sigint (int s)
void sighup (int s)
void sigusr1 (int s)
void sigusr2 (int s)
void sigpipe (int s)
void siginit (void)
int main (int argc, char *argv[])

Variables

int m_quit = 0


Define Documentation

#define DEB  ) 
 

Definition at line 26 of file chat.cpp.

Referenced by sighup(), and sigint().


Function Documentation

int main int  argc,
char *  argv[]
 

Definition at line 68 of file chat.cpp.

References m_quit, and siginit().

00069 { 00070 ChatHandler h; 00071 ListenSocket<ChatSocket> l(h); 00072 siginit(); 00073 00074 if (l.Bind(4440)) 00075 { 00076 exit(-1); 00077 } 00078 h.Add(&l); 00079 while (!m_quit) 00080 { 00081 h.Select(1,0); 00082 } 00083 }

void sighup int  s  ) 
 

Definition at line 39 of file chat.cpp.

References DEB, and m_quit.

Referenced by siginit().

00040 { 00041 DEB( printf("sighup\n");) 00042 m_quit++; 00043 }

void siginit void   ) 
 

Definition at line 57 of file chat.cpp.

References sighup(), sigint(), sigpipe(), sigusr1(), and sigusr2().

Referenced by main().

00058 { 00059 signal(SIGINT, (__sighandler_t)sigint); 00060 signal(SIGHUP, (__sighandler_t)sighup); 00061 signal(SIGUSR1, (__sighandler_t)sigusr1); 00062 signal(SIGUSR2, (__sighandler_t)sigusr2); 00063 signal(SIGPIPE, (__sighandler_t)sigpipe); 00064 }

void sigint int  s  ) 
 

Definition at line 33 of file chat.cpp.

References DEB, and m_quit.

Referenced by siginit().

00034 { 00035 DEB( printf("sigint\n");) 00036 m_quit++; 00037 }

void sigpipe int  s  ) 
 

Definition at line 53 of file chat.cpp.

Referenced by siginit().

00054 { 00055 }

void sigusr1 int  s  ) 
 

Definition at line 45 of file chat.cpp.

Referenced by siginit().

00046 { 00047 }

void sigusr2 int  s  ) 
 

Definition at line 49 of file chat.cpp.

Referenced by siginit().

00050 { 00051 }


Variable Documentation

int m_quit = 0 [static]
 

Definition at line 29 of file chat.cpp.

Referenced by main(), sighup(), and sigint().


Generated for C++ Sockets by doxygen 1.3.6

www.TV-friendship.com
The matchmaking service with an all new twist.

Quantum 'Teleportation'
Some thoughts
Page, code, and content Copyright (C) 2004 by Anders Hedström