Crossfire Server, Branch 1.12  R12190
Functions | Variables
init.c File Reference

Socket general functions. More...

#include <global.h>
#include <sproto.h>
#include <sys/types.h>
#include <sys/time.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <netdb.h>
#include <newserver.h>
#include <loader.h>
Include dependency graph for init.c:

Go to the source code of this file.

Functions

void final_free_player (player *pl)
 Sends the 'goodbye' command to the player, and closes connection.
void free_all_newserver (void)
 Free's all the memory that ericserver allocates.
void free_newsocket (socket_struct *ns)
 Frees a socket.
void init_connection (socket_struct *ns, const char *from_ip)
 Initializes a connection.
void init_server (void)
 This sets up the socket and reads all the image information into memory.

Variables

socket_structinit_sockets
 Established connections for clients not yet playing.
Socket_Info socket_info
 Socket information.

Detailed Description

Socket general functions.

Date:
2003-12-02

Mainly deals with initialization and higher level socket maintenance (checking for lost connections and if data has arrived.) The reading of data is handled in ericserver.c

Definition in file init.c.


Function Documentation

void final_free_player ( player pl)

Sends the 'goodbye' command to the player, and closes connection.

Definition at line 328 of file init.c.

References free_newsocket(), free_player(), Send_With_Handling(), pl::socket, SockList_AddString(), SockList_Init(), and SockList_Term().

Referenced by check_login(), and do_server().

Here is the call graph for this function:

Here is the caller graph for this function:

void free_all_newserver ( void  )

Free's all the memory that ericserver allocates.

Definition at line 292 of file init.c.

References free_socket_images(), llevDebug, and LOG().

Referenced by cleanup().

Here is the call graph for this function:

Here is the caller graph for this function:

void free_newsocket ( socket_struct ns)

Frees a socket.

Basically, all we need to do here is free all data structures that might be associated with the socket. It is up to the caller to update the list

Definition at line 305 of file init.c.

References socket_struct::fd, FREE_AND_CLEAR, socket_struct::host, socket_struct::inbuf, llevDebug, LOG(), statsinfo::range, SockList_Term(), socket_struct::stats, and statsinfo::title.

Referenced by do_server(), and final_free_player().

Here is the call graph for this function:

Here is the caller graph for this function:

void init_connection ( socket_struct ns,
const char *  from_ip 
)
void init_server ( void  )

This sets up the socket and reads all the image information into memory.

Definition at line 173 of file init.c.

References Socket_Info::allocated_sockets, Settings::csport, cst_lst, cst_tot, socket_struct::faces_sent, socket_struct::fd, llevDebug, llevError, LOG(), MAX_BUF, Socket_Info::max_filedescriptor, Socket_Info::nconns, Ns_Add, read_client_images(), settings, socket_struct::status, strerror_local(), CS_Stats::time_start, and Socket_Info::timeout.

Referenced by init().

Here is the call graph for this function:

Here is the caller graph for this function:


Variable Documentation

Established connections for clients not yet playing.

See the page on the login process for a description of its use.

Definition at line 68 of file init.c.

Referenced by block_until_new_connection(), and do_server().

Socket information.

Definition at line 63 of file init.c.

Referenced by add_me_cmd(), block_until_new_connection(), and do_server().