RelativeResourceManager5

- c lient.c R outine to send datagram packets to a server d efault port is 2000 and default server is

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
/* ******************************************************************************* * * client.c -- * Routine to send datagram packets to a server * default port is 2000 and default server is spock * ******************************************************************************* */ #include <sys/types.h> #include <sys/time.h> #include <sys/socket.h> #include <netinet/in.h> #include <arpa/inet.h> #include <netdb.h> #include <stdio.h> #include <unistd.h> #include <stdlib.h> #include <string.h> #include <sys/select.h> #define HOST "spock.ee.iastate.edu" #define PORT 2000 struct sockaddr_in sock_in, temp, from_addr; int from_len; extern int errno; main(argc, argv) int argc; char **argv; { struct timeval timeout; register int n; u_short len; char *cp; int i, retry, resplen, done = 0 ; int dsmask, flags, sockFD; char buf[ 100 ],answer[ 4048 ]; struct hostent *h_name; struct servent *s_name; char hostname[ 100 ]; int numTimeOuts = 0 ; sockFD = - 1 ; opterr = 0 ; strcpy(hostname, HOST); while ((i = getopt(argc, argv,
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 11/22/2009 for the course CPR E 530 taught by Professor Staff during the Spring '08 term at Iowa State.

Page1 / 2

- c lient.c R outine to send datagram packets to a server d efault port is 2000 and default server is

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online