server.h File Reference

This is an header file for "server.c" which includes all the header files and global variables used. More...

#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <strings.h>
#include <sys/socket.h>
#include <sys/types.h>
#include <netinet/in.h>
#include <time.h>
#include <signal.h>
#include <sys/select.h>
#include <fcntl.h>
#include <sys/time.h>
#include <arpa/inet.h>
#include <pthread.h>
#include <gtk/gtk.h>
#include <mysql/mysql.h>

Go to the source code of this file.

Classes

struct  client_data
 Used for storing client information like file descriptor through which client is connected, nick name of the connected client, ip address of client machine. More...
struct  transmit_unit
 Used as the the basic unit of communication between client and server. More...

Defines

#define BUFFER   4096
 defines maximum data transfer
#define DATASIZE   100
 defines data size for ip, nick

Variables

GtkWidget * entry_port
 GTK entry for entering the port number on which server should listen.
GtkTextBuffer * buffer
 for chat window
GtkTextIter iter
 iterator for textbuffer used in chat window
GtkListStore * list_store
 for showing the list of connected clients
GtkTreeIter t_iter
 iterator for list which is used for listing connected clients
int listen_file_descriptor
 the file descriptor on which server listens
struct client_data client [FD_SETSIZE]
 For storing each client information.
int maxi
 temporary variable used for storing the number of clients connected currently
char err_msg [BUFFER]
 used for storing error message when there are any errors
char ip [BUFFER]
 used for storing ip address of client
char nick [BUFFER]
 used for storing nick name of client
int success
 temporary variable used for proper server set up
MYSQL * connection1
 Handler for mysql connection.


Detailed Description

This is an header file for "server.c" which includes all the header files and global variables used.

Author:
Ratna Kumar K.V.R

Definition in file server.h.


Define Documentation

#define BUFFER   4096

defines maximum data transfer

Definition at line 25 of file server.h.

Referenced by start_server(), and write_all().

#define DATASIZE   100

defines data size for ip, nick

Definition at line 26 of file server.h.


Variable Documentation

GtkTextBuffer* buffer

for chat window

Definition at line 53 of file server.h.

Referenced by main(), start_server(), and write_all().

struct client_data client[FD_SETSIZE]

For storing each client information.

The server can handle maximum FD_SETSIZE number of clients

Definition at line 62 of file server.h.

Referenced by close_properly(), end_program(), isNickExists(), start_server(), and write_all().

MYSQL* connection1

Handler for mysql connection.

Definition at line 71 of file server.h.

Referenced by close_properly(), end_program(), insert_row(), and mysql_connect_create_table().

GtkWidget* entry_port

GTK entry for entering the port number on which server should listen.

Definition at line 52 of file server.h.

Referenced by connect_server(), and main().

char err_msg[BUFFER]

used for storing error message when there are any errors

Definition at line 65 of file server.h.

Referenced by Bind(), connect_server(), Listen(), and Socket().

char ip[BUFFER]

used for storing ip address of client

Definition at line 66 of file server.h.

Referenced by start_server(), and write_all().

GtkTextIter iter

iterator for textbuffer used in chat window

Definition at line 54 of file server.h.

Referenced by main(), start_server(), and write_all().

GtkListStore* list_store

for showing the list of connected clients

Definition at line 56 of file server.h.

Referenced by main(), and start_server().

the file descriptor on which server listens

Definition at line 60 of file server.h.

Referenced by close_properly(), connect_server(), end_program(), and start_server().

int maxi

temporary variable used for storing the number of clients connected currently

Definition at line 64 of file server.h.

Referenced by close_properly(), end_program(), isNickExists(), start_server(), and write_all().

char nick[BUFFER]

used for storing nick name of client

Definition at line 67 of file server.h.

Referenced by start_server(), and write_all().

int success

temporary variable used for proper server set up

Definition at line 68 of file server.h.

Referenced by Bind(), connect_server(), Listen(), and Socket().

GtkTreeIter t_iter

iterator for list which is used for listing connected clients

Definition at line 57 of file server.h.

Referenced by start_server().


Generated on Wed Apr 7 17:06:31 2010 for LAN-Messenger(Server) by  doxygen 1.5.8