diff options
Diffstat (limited to 'Bachelor/Verteilte Systeme/Praktikum2/loesung_neu/addiere_client.c_NACH_Ergaenzung')
| -rw-r--r-- | Bachelor/Verteilte Systeme/Praktikum2/loesung_neu/addiere_client.c_NACH_Ergaenzung | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/Bachelor/Verteilte Systeme/Praktikum2/loesung_neu/addiere_client.c_NACH_Ergaenzung b/Bachelor/Verteilte Systeme/Praktikum2/loesung_neu/addiere_client.c_NACH_Ergaenzung new file mode 100644 index 0000000..e6b9887 --- /dev/null +++ b/Bachelor/Verteilte Systeme/Praktikum2/loesung_neu/addiere_client.c_NACH_Ergaenzung @@ -0,0 +1,58 @@ +/* + * This is sample code generated by rpcgen. + * These are only templates and you can use them + * as a guideline for developing your own functions. + */ + +#include "addiere.h" + + +void +addiere_test_1(char *host) +{ + CLIENT *clnt; + int *result_1; + add_struct addiere_1_arg; + +#ifndef DEBUG + clnt = clnt_create (host, ADDIERE_TEST, ONE, "udp"); + if (clnt == NULL) { + clnt_pcreateerror (host); + exit (1); + } +#endif /* DEBUG */ + + /* my code START */ + addiere_1_arg.p1 = 5; + addiere_1_arg.p2 = 6; + /* my code END */ + + result_1 = addiere_1(&addiere_1_arg, clnt); + if (result_1 == (int *) NULL) { + clnt_perror (clnt, "call failed"); + } + /* my code START */ + else { + printf("addiere(5,6) liefert %d\n", *result_1); + } + /* my code END */ + +#ifndef DEBUG + clnt_destroy (clnt); +#endif /* DEBUG */ +} + + +int +main (int argc, char *argv[]) +{ + char *host; + + if (argc < 2) { + printf ("usage: %s server_host\n", argv[0]); + exit (1); + } + host = argv[1]; + addiere_test_1 (host); +exit (0); +} |
