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

Client Reference

Last modified: 22/04/2004 05:21:39 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 -

tcpcli.c File Reference

Client module. More...

Go to the source code of this file.

Includes

"wrapsock.h"

Functions

int main (int argc, char *argv[])
Main entry in client module.

Variables

int sockfd = 0
create the socket.

int chopt
dummy variable for options test.

int port_served = 0
port to connect.

int bflag = 0
dummy variable for number of addresses supplied.

char progname [MAXLINE]
program's name.

char addropt [MAXLINE]
bound address.

struct sockaddr_in servaddr
structure of socket address.


Detailed Description

Client module.

Usage

example: ./tcpcli -a 127.0.0.1

Features

- Check the arguments supplied by the user

- Retrieve the program's name

- Check if 3 arguments were supplied, if not display help message and quit

- Check if the option supplied is a valid one, if not display help message and quit

- Check if address was supplied, if not display help message and quit

- Check if only one address was supplied, if not display help message and quit

- Compute the real port number

- Check if port was supplied with a dash before it, if not display help message and quit

- Print an help message on the terminal io

- Create an active socket

- Fill in the address structure, if address supplied not valid, display help message and quit

- Make a connection to the server's socket

- Write the request for the server to the socket

Definition in file tcpcli.c.


Function Documentation

int main (int argc, char *argv[])
Main entry in client module.

Parameters:
argc => number of arguments.
argv[] => value of arguments.
Returns:
status of exit to the system when quitting.

Definition at line 38 of file tcpcli.c.

References: addropt[MAXLINE], bflag, chopt, port_served, progname[MAXLINE], servaddr, sockfd
cliusage(), Inet_pton(), Connect(), Socket(), str_cli()
SERV_PORT1, SERV_PORT3, SA.


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:32 CEST