Catch connect errors

This commit is contained in:
Alex Hultman
2021-02-15 20:10:15 +01:00
parent 6f1c0d8022
commit 1ef15da77b
+4
View File
@@ -64,6 +64,10 @@ void test() {
struct us_socket_context_t *client_context = us_create_socket_context(0, loop, 0, {});
client = us_socket_context_connect(0, client_context, "hostname", 5000, "localhost", 0, 0);
us_socket_context_on_connect_error(0, client_context, [](struct us_socket_t *s, int code) {
return s;
});
us_socket_context_on_open(0, client_context, [](struct us_socket_t *s, int is_client, char *ip, int ip_length) {
us_socket_flush(0, s);
return s;