Links Powered by MicMac
Cocoa-C-Porting
Fink's translation team
Mac OSX, Fink and Unix
Client/Server Architecture
PowerPC Architecture - UML
System programming
Merise
Pierre-Loïc and Pascaline's wedding

Header Reference

Last modified: 22/04/2004 05:21:41 CEST
Author: Michèle Garoche contact

Contents - Overview - Diagrams - Client documentation - Server documentation - Functions documentation - Headers documentation - Client source code - Server source code - Functions source code - Headers source code -

wrapsock.h File Reference

Headers for tcpcli, tcpserv, wrapsock. More...

Go to the source code of this file.

Includes

#include <stdio.h>
fprintf, snprintf, strerror, fflush, fputs, sscanf,fgets, ferror, printf, vsnprintf, fileno, stdout, stderr, FILE, EOF

#include <stdlib.h>
exit, EXIT_SUCCESS, EXIT_FAILURE

#include <sys/socket.h>
accept, connect, bind, listen, socket, shutdown, SHUT_WR

#include <string.h>
strcpy, bzero, strlen, strcat, strerror

#include <unistd.h>
getpid, getopt, fork, read, close, write, select

#include <sys/errno.h>
errno, EINTR

#include <arpa/inet.h>
htons, htonl, inet_pton

#include <netinet/in.h>
storage size of struct address, INADDR_ANY

#include <stdarg.h>
va_list, va_start, va_end

#include <syslog.h>
syslog, LOG_ERR

#include <sys/wait.h>
waitpid, WNOHANG

#include <math.h>
pow

#include <ctype.h>
isupper, isdigit, tolower

Typedefs

typedef void Sigfunc (int)
Convenient definition to make it easier to read the code.

Defines

#define socklen_t unsigned int
defined before the right type get a chance to be defined.

#define SERV_PORT1 9877
port to handle all requests.

#define SERV_PORT2 9878
port to handle numeric requests.

#define SERV_PORT3 9879
port to handle word conversion.

#define MAXLINE 4096
length of a line.

#define LISTENQ 128
maximum number of pending connections.

#define SA struct sockaddr
convenience to make it easier to read the code.

#define MGMAX(a,b) (((a) > (b)) ? (a) : (b))
returns the maximum of a and b.

Functions

void cliusage (char *)

void Inet_pton (int, const char *, void *)

void Connect (int, const struct sockaddr *, socklen_t)

void str_cli (FILE *, int)

void servusage (char *)

void Bind (int, const struct sockaddr *, socklen_t)

void Listen (int, int)

Sigfunc * Signal (int, Sigfunc *)

pid_t Fork (void)

void Close (int)

void str_serv1 (int)

void str_serv2 (int)

void str_serv3 (int)

int Socket (int, int, int)

char * Fgets (char *, int, FILE *)

ssize_t mg_readline (int, void *, size_t)

ssize_t Readline (int, void *, size_t)

void Fputs (const char *, FILE *)

ssize_t writen (int, const void *, size_t)

void Writen (int, void *, size_t)

Sigfunc * mg_signal (int, Sigfunc *)

int Select (int, fd_set *, fd_set *, fd_set *, struct timeval *)

void Shutdown (int, int)

void err_sys (const char *fmt,...)

void err_quit (const char *fmt,...)

Extern globals

char * optarg = 0
points to the option argument supplied by the user.

int optind = 0
index of the next argument on return.

int optopt = 0
last known option on return.

int opterr = 0
on return error.

int optreset = 0
not used here.


Detailed Description

Headers for tcpcli, tcpserv, wrapsock.

- Global variables for checking options

- Constants used in all modules

- Wrappers for primitives with error checking

- Specific functions used in client and server

- Functions for read and write operations

Definitions of functions in file wrapsock.c

Documentation in file wrapsock.c Reference


Generated on Sat Mar 1 04:09:03 2003 for tcpcliserv by doxygen


Contents - Overview - Diagrams - Client documentation - Server documentation - Functions documentation - Headers documentation - Client source code - Server source code - Functions source code - Headers source code -

Powered by Apache/1.3.41 (Darwin) PHP/4.4.8 on Mac OS X bluefish distributed.net Cssed icon Conglomerate icon Valid HTML 4.0.1 Valid CSS
Local date (dd/mm/yyyy): 29/08/2008 05:59:56 CEST