1
0
mirror of https://github.com/gryf/wmaker.git synced 2025-12-21 21:38:00 +01:00

Small enhance to connection client example.

This commit is contained in:
dan
1999-12-14 04:41:56 +00:00
parent 285dea0340
commit 87368574a3

View File

@@ -57,14 +57,6 @@ wAbort(Bool foo) /*FOLD00*/
} }
static void
printHelp(char *progname) /*FOLD00*/
{
printf("usage: %s [host [port]]\n\n", progname);
printf(" --help print this message\n");
}
static char* static char*
getMessage(WMConnection *cPtr) getMessage(WMConnection *cPtr)
{ {
@@ -175,8 +167,8 @@ main(int argc, char **argv) /*FOLD00*/
if (argc>1) { if (argc>1) {
for (i=1; i<argc; i++) { for (i=1; i<argc; i++) {
if (strcmp(argv[i], "--help")==0) { if (strcmp(argv[i], "--help")==0 || strcmp(argv[i], "-h")==0) {
printHelp(argv[0]); printf("usage: %s [host [port]]\n\n", argv[0]);
exit(0); exit(0);
} else { } else {
if (!host) if (!host)
@@ -187,6 +179,9 @@ main(int argc, char **argv) /*FOLD00*/
} }
} }
printf("Trying to make connection to '%s:%s'\n",
host?host:"localhost", port);
sPtr = WMCreateConnectionToAddressAndNotify(host, port, NULL); sPtr = WMCreateConnectionToAddressAndNotify(host, port, NULL);
if (!sPtr) { if (!sPtr) {
wfatal("could not create connection. exiting"); wfatal("could not create connection. exiting");