Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Partial shutdown socket handle release. #82

Open
vrishe opened this issue May 16, 2023 · 0 comments
Open

Partial shutdown socket handle release. #82

vrishe opened this issue May 16, 2023 · 0 comments
Milestone

Comments

@vrishe
Copy link

vrishe commented May 16, 2023

Does partial shutdown modes (SHUT_RD, SHUT_WR) should necessarily release the socket handle?

It becomes a bit of a hassle to achieve something like the following:

auto conn_h = conn.release();
{
  sockpp::socket sd_sock(conn_h);
  // We end up with writing on client side explicitly,
  // so the receiver's aware an icoming data stream is over.
  if (!sd_sock.shutdown(SHUT_WR))
    throw io::transfer_error::from_sock(sd_sock);
}
sockpp::stream_socket rd_sock(conn_h);
// read the response through rd_sock here
// ...
@fpagliughi fpagliughi added this to the v0.9 milestone Dec 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants