mirror of
https://github.com/asterinas/asterinas.git
synced 2025-06-23 17:33:23 +00:00
Properly close sockets
This commit is contained in:
committed by
Tate, Hongliang Tian
parent
94b23e077d
commit
328ce9e92c
@ -131,7 +131,7 @@ int main(void)
|
||||
|
||||
for (backlog = 0; backlog <= MAX_TEST_BACKLOG; ++backlog) {
|
||||
// Avoid "bind: Address already in use"
|
||||
addr.sin_port = htons(8080 + backlog);
|
||||
addr.sin_port = htons(10000 + backlog);
|
||||
|
||||
err = test_listen_backlog(&addr, backlog);
|
||||
if (err != 0)
|
||||
|
@ -265,7 +265,7 @@ int main(void)
|
||||
struct sockaddr_in addr;
|
||||
|
||||
addr.sin_family = AF_INET;
|
||||
addr.sin_port = htons(8080);
|
||||
addr.sin_port = htons(9999);
|
||||
if (inet_aton("127.0.0.1", &addr.sin_addr) < 0) {
|
||||
fprintf(stderr, "inet_aton cannot parse 127.0.0.1\n");
|
||||
return -1;
|
||||
|
Reference in New Issue
Block a user