#include <string.h>
#include <unistd.h>
#include <signal.h>
#include "gwlib/gwlib.h"
Go to the source code of this file.
|
int | main (int argc, char **argv) |
|
◆ main()
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(), host, octstr_create, octstr_destroy(), octstr_get_cstr, panic, and port.
81 panic(0,
"Syntax: %s <host> <port>\n", argv[0]);
87 debug(
"",0,
"Connecting to host '%s', port %d, looping %i times.",
90 for (i = 0; i <= 50; i++) {
93 panic(0,
"Couldn't connect.");
95 debug(
"",0,
"%d: connected.", i);
97 debug(
"",0,
"%d: closing.", i);
Connection * conn_open_tcp(Octstr *host, int port, Octstr *our_host)
#define octstr_get_cstr(ostr)
void conn_destroy(Connection *conn)
void octstr_destroy(Octstr *ostr)
#define octstr_create(cstr)
void gwthread_sleep(double seconds)
void debug(const char *place, int err, const char *fmt,...)
void gwlib_shutdown(void)
int get_and_set_debugs(int argc, char **argv, int(*find_own)(int index, int argc, char **argv))