Mercurial > hg > th-libs
comparison th_network.h @ 103:f7bec3f7181d
Change connection creation API to specify incoming buffer size.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Sat, 21 Jun 2014 05:11:06 +0300 |
parents | 6ca407bfbeaf |
children | ea5b1c4b3af5 |
comparison
equal
deleted
inserted
replaced
102:6ca407bfbeaf | 103:f7bec3f7181d |
---|---|
107 | 107 |
108 int err; | 108 int err; |
109 int status; | 109 int status; |
110 | 110 |
111 // Data buffer | 111 // Data buffer |
112 char buf[TH_CONNBUF_SIZE + 16]; | 112 char *buf, *ptr, *in_ptr; |
113 char *ptr, *in_ptr; | 113 ssize_t bufsize, got_bytes, total_bytes; |
114 ssize_t got_bytes, total_bytes; | |
115 | 114 |
116 void *node; | 115 void *node; |
117 } th_conn_t; | 116 } th_conn_t; |
118 | 117 |
119 | 118 |
121 void th_network_close(void); | 120 void th_network_close(void); |
122 | 121 |
123 struct hostent *th_resolve_host(th_conn_t *conn, const char *name); | 122 struct hostent *th_resolve_host(th_conn_t *conn, const char *name); |
124 th_conn_t * th_conn_new( | 123 th_conn_t * th_conn_new( |
125 void (*errfunc)(th_conn_t *conn, int err, const char *msg), | 124 void (*errfunc)(th_conn_t *conn, int err, const char *msg), |
126 void (*msgfunc)(th_conn_t *conn, int loglevel, const char *msg)); | 125 void (*msgfunc)(th_conn_t *conn, int loglevel, const char *msg), |
126 ssize_t bufsize); | |
127 | 127 |
128 void th_conn_err(th_conn_t *conn, int err, const char *fmt, ...); | 128 void th_conn_err(th_conn_t *conn, int err, const char *fmt, ...); |
129 void th_conn_msg(th_conn_t *conn, int loglevel, const char *fmt, ...); | 129 void th_conn_msg(th_conn_t *conn, int loglevel, const char *fmt, ...); |
130 | 130 |
131 int th_conn_set_proxy(th_conn_t *conn, int type, int port, const char *host, int auth_type); | 131 int th_conn_set_proxy(th_conn_t *conn, int type, int port, const char *host, int auth_type); |