From: Enlightenment S. <no-...@en...> - 2012-05-14 14:37:59
|
Log: clouseau: Taking PORT from helper.h Signed-off-by: Aharon Hillel <a.h...@pa...> Author: tasn Date: 2012-05-14 07:37:53 -0700 (Mon, 14 May 2012) New Revision: 71007 Trac: http://trac.enlightenment.org/e/changeset/71007 Modified: trunk/clouseau/src/lib/client.c trunk/clouseau/src/lib/libclouseau.c Modified: trunk/clouseau/src/lib/client.c =================================================================== --- trunk/clouseau/src/lib/client.c 2012-05-14 14:37:49 UTC (rev 71006) +++ trunk/clouseau/src/lib/client.c 2012-05-14 14:37:53 UTC (rev 71007) @@ -196,29 +196,20 @@ struct sockaddr_in servaddr; /* socket address structure */ char buffer[MAX_LINE]; /* character buffer */ char *szAddress = "127.0.0.1"; /* Holds remote IP address */ - char *szPort = "5555"; /* Holds remote port */ - char *endptr; /* for strtol() */ - /* Get command line arguments ParseCmdLine(argc, argv, &szAddress, &szPort); */ /* Set the remote port */ - port = strtol(szPort, &endptr, 0); - if ( *endptr ) { - printf("ECHOCLNT: Invalid port supplied.\n"); - exit(EXIT_FAILURE); - } + port = ECHO_PORT; - /* Create the listening socket */ if ( (conn_s = socket(AF_INET, SOCK_STREAM, 0)) < 0 ) { fprintf(stderr, "ECHOCLNT: Error creating listening socket.\n"); exit(EXIT_FAILURE); } - /* Set all bytes in socket address structure to zero, and fill in the relevant data members */ memset(&servaddr, 0, sizeof(servaddr)); Modified: trunk/clouseau/src/lib/libclouseau.c =================================================================== --- trunk/clouseau/src/lib/libclouseau.c 2012-05-14 14:37:49 UTC (rev 71006) +++ trunk/clouseau/src/lib/libclouseau.c 2012-05-14 14:37:53 UTC (rev 71007) @@ -140,24 +140,12 @@ int conn_s; /* connection socket */ short int port; /* port number */ struct sockaddr_in servaddr; /* socket address structure */ - char buffer[1024]; /* character buffer */ + char buffer[MAX_LINE]; /* character buffer */ char *szAddress = "127.0.0.1"; /* Holds remote IP address */ - char *szPort = "5555"; /* Holds remote port */ - char *endptr; /* for strtol() */ - - /* Get command line arguments - ParseCmdLine(argc, argv, &szAddress, &szPort); */ - - /* Set the remote port */ - port = strtol(szPort, &endptr, 0); - if ( *endptr ) { - printf("ECHOCLNT: Invalid port supplied.\n"); - exit(EXIT_FAILURE); - } + port = ECHO_PORT; - /* Create the listening socket */ if ( (conn_s = socket(AF_INET, SOCK_STREAM, 0)) < 0 ) { fprintf(stderr, "ECHOCLNT: Error creating listening socket.\n"); |