optional IPv6 for echo-server
This commit is contained in:
parent
afff934953
commit
a4b05abce6
@ -193,17 +193,18 @@ static int echo_start(int port) {
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* IPv6 is optional as not all platforms support it */
|
||||||
r = uv_tcp_bind6(&server6, addr6);
|
r = uv_tcp_bind6(&server6, addr6);
|
||||||
if (r) {
|
if (r) {
|
||||||
/* TODO: Error codes */
|
/* show message but return OK */
|
||||||
fprintf(stderr, "Bind6 error\n");
|
fprintf(stderr, "IPv6 not supported\n");
|
||||||
return 1;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
r = uv_tcp_listen(&server6, 128, on_connection);
|
r = uv_tcp_listen(&server6, 128, on_connection);
|
||||||
if (r) {
|
if (r) {
|
||||||
/* TODO: Error codes */
|
/* TODO: Error codes */
|
||||||
fprintf(stderr, "Listen error\n");
|
fprintf(stderr, "Listen error on IPv6\n");
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user