|
DataMuseum.dkPresents historical artifacts from the history of: DKUUG/EUUG Conference tapes |
This is an automatic "excavation" of a thematic subset of
See our Wiki for more about DKUUG/EUUG Conference tapes Excavated with: AutoArchaeologist - Free & Open Source Software. |
top - metrics - downloadIndex: T f
Length: 732 (0x2dc) Types: TextFile Names: »findserv.c«
└─⟦a0efdde77⟧ Bits:30001252 EUUGD11 Tape, 1987 Spring Conference Helsinki └─⟦this⟧ »EUUGD11/euug-87hel/sec8/inet/findserv.c«
#include <stdio.h> #include "service.h" #define TIMEOUT 10 #define SIGN_ON "sign on." #define NUM_MSGS 5 int sock_to_serv; char in_buf[BUFSIZ]; main( argc, argv) int argc; char *argv[]; { int i; char *msg = "They're here!"; if ( argc > 1 ) msg = argv[1]; if ( (sock_to_serv = obtain_service( SERV_NAME, SERV_PORT, TIMEOUT, SIGN_ON, sizeof(SIGN_ON) )) < 0 ) { fprintf( stderr, "Service request timed out\n" ); exit(1); } printf( "Client side started\n" ); for ( i = 0; i < NUM_MSGS; ++i ) { datagram_string( sock_to_serv, msg ); sleep(5); } close(sock_to_serv); } int datagram_string( sock, string ) int sock; char *string; { write( sock, string, strlen(string) ); }