Skip to content

Commit

Permalink
Initial imp,ementation of accept()
Browse files Browse the repository at this point in the history
  • Loading branch information
smuehlst committed Feb 13, 2024
1 parent 089601b commit b34d8dd
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 2 deletions.
2 changes: 1 addition & 1 deletion libs/circle-newlib
19 changes: 18 additions & 1 deletion samples/05-smoketest/kernel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -861,11 +861,28 @@ void CKernel::SocketTest(void)

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

#if 0
// TODO this currently hangs even when a connection attempt is made.
int connected_fd = accept(fd, nullptr, nullptr);

if (connected_fd == -1)
{
PErrorExit("accept (fd) failed");
}

Report("accept() on file descriptor %d returned %d", fd, connected_fd);

if (close(connected_fd) < 0)
{
PErrorExit("close (connected_fd) failed");
}
#endif

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

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

0 comments on commit b34d8dd

Please sign in to comment.