Catch connect errors
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user