From 727af5678906c03eedff8d8262d39fad788973a6 Mon Sep 17 00:00:00 2001 From: Linus Nordberg Date: Wed, 29 Sep 2010 21:53:43 +0200 Subject: Refactoring in preparation for handling more cases than client sending one packet. --- lib/examples/client.c | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) (limited to 'lib/examples') diff --git a/lib/examples/client.c b/lib/examples/client.c index 14555c7..d7e7270 100644 --- a/lib/examples/client.c +++ b/lib/examples/client.c @@ -38,9 +38,17 @@ rsx_client (const char *srvname, int srvport) return rs_conn_err_pop (conn); req = NULL; +#if 0 + if (rs_packet_recv (conn, &resp)) + return rs_conn_err_pop (conn); +#if defined (DEBUG) + rs_dump_packet (resp); +#endif +#endif + rs_conn_destroy (conn); rs_context_destroy (h); - return 0; + return NULL; } int @@ -53,8 +61,10 @@ main (int argc, char *argv[]) host = strsep (argv + 1, ":"); port = atoi (argv[1]); err = rsx_client (host, port); - if (!err) - return -1; - fprintf (stderr, "%s\n", rs_err_msg (err, 0)); - return rs_err_code (err, 1); + if (err) + { + fprintf (stderr, "%s\n", rs_err_msg (err, 0)); + return rs_err_code (err, 1); + } + return 0; } -- cgit v1.1