#include <string.h>#include <unistd.h>#include <signal.h>#include "gwlib/gwlib.h"Include dependency graph for test_conn.c:

Go to the source code of this file.
Functions | |
| int | main (int argc, char **argv) |
|
||||||||||||
|
Definition at line 70 of file test_conn.c. References conn_destroy(), conn_open_tcp(), debug(), get_and_set_debugs(), gwlib_init(), gwlib_shutdown(), gwthread_sleep(), octstr_create, octstr_destroy(), octstr_get_cstr, panic, and port. 00071 {
00072 Connection *conn;
00073 Octstr *host = NULL;
00074 int port, i;
00075
00076 gwlib_init();
00077
00078 get_and_set_debugs(argc, argv, NULL);
00079
00080 host = octstr_create(argv[1]);
00081 port = atoi(argv[2]);
00082 i = 50;
00083
00084 debug("",0,"Connecting to host '%s', port %d, looping %i times.",
00085 octstr_get_cstr(host), port, i);
00086
00087 for (i = 0; i <= 50; i++) {
00088 conn = conn_open_tcp(host, port, NULL);
00089 if (conn == NULL) {
00090 panic(0, "Couldn't connect.");
00091 }
00092 debug("",0,"%d: connected.", i);
00093 gwthread_sleep(0.2);
00094 debug("",0,"%d: closing.", i);
00095 conn_destroy(conn);
00096 }
00097
00098 octstr_destroy(host);
00099 gwlib_shutdown();
00100 return 0;
00101 }
|
Here is the call graph for this function:
