| 73 nm_ssl_write_cb write; |
73 nm_ssl_write_cb write; |
| 74 |
74 |
| 75 }; |
75 }; |
| 76 |
76 |
| 77 /** |
77 /** |
| |
78 * Allocate a new NMConn struct |
| |
79 * |
| |
80 * @param The address of the server that we are connecting to. |
| |
81 * @param The port that we are connecting to. |
| |
82 * |
| |
83 * @return A pointer to a newly allocated NMConn struct, should |
| |
84 * be freed by calling nm_release_conn() |
| |
85 */ |
| |
86 NMConn *nm_create_conn(const char *addr, int port); |
| |
87 |
| |
88 /** |
| |
89 * Release an NMConn |
| |
90 * |
| |
91 * @param Pointer to the NMConn to release. |
| |
92 * |
| |
93 */ |
| |
94 void nm_release_conn(NMConn *conn); |
| |
95 |
| |
96 /** |
| 78 * Write len bytes from the given buffer. |
97 * Write len bytes from the given buffer. |
| 79 * |
98 * |
| 80 * @param conn The connection to write to. |
99 * @param conn The connection to write to. |
| 81 * @param buff The buffer to write from. |
100 * @param buff The buffer to write from. |
| 82 * @param len The number of bytes to write. |
101 * @param len The number of bytes to write. |
| 133 * Dispatch a request to the server. |
152 * Dispatch a request to the server. |
| 134 * |
153 * |
| 135 * @param conn The connection. |
154 * @param conn The connection. |
| 136 * @param cmd The request to dispatch. |
155 * @param cmd The request to dispatch. |
| 137 * @param fields The field list for the request. |
156 * @param fields The field list for the request. |
| |
157 * @param cb The response callback for the new request object. |
| |
158 * @param data The user defined data for the request (to be passed to the resp cb). |
| 138 * @param req The request. Should be freed with nm_release_request. |
159 * @param req The request. Should be freed with nm_release_request. |
| 139 * |
160 * |
| 140 * @return NM_OK on success. |
161 * @return NM_OK on success. |
| 141 */ |
162 */ |
| 142 NMERR_T nm_send_request(NMConn * conn, char *cmd, NMField * fields, |
163 NMERR_T |
| 143 NMRequest ** req); |
164 nm_send_request(NMConn *conn, char *cmd, NMField *fields, |
| |
165 nm_response_cb cb, gpointer data, NMRequest **request); |
| 144 |
166 |
| 145 /** |
167 /** |
| 146 * Write out the given field list. |
168 * Write out the given field list. |
| 147 * |
169 * |
| 148 * @param conn The connection to write to. |
170 * @param conn The connection to write to. |