Skip to content

Commit

Permalink
Implemented listen()
Browse files Browse the repository at this point in the history
  • Loading branch information
smuehlst committed Feb 12, 2024
1 parent 87d4858 commit 089601b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
2 changes: 1 addition & 1 deletion libs/circle-newlib
13 changes: 11 additions & 2 deletions samples/05-smoketest/kernel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -827,7 +827,7 @@ void CKernel::SocketTest(void)

Report("Basic socket() tests successful");

Report("Basic bind() test");
Report("Basic socket lifecycle test");

{
int const fd = socket(AF_INET, SOCK_STREAM, 0);
Expand All @@ -852,11 +852,20 @@ void CKernel::SocketTest(void)

Report("bind() on file descriptor %d succeeded", fd);

int const listen_result = listen(fd, 3);

if (listen_result == -1)
{
PErrorExit("listen() failed");
}

Report("listen() on file descriptor %d succeeded", fd);

if (close(fd) < 0)
{
PErrorExit("close (fd) failed");
}
}

Report("Basic bind() test successful");
Report("Basic socket lifecycle test successful");
}

0 comments on commit 089601b

Please sign in to comment.