Skip to content

Partial shutdown socket handle release. #82

@vrishe

Description

@vrishe

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
// ...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions