Skip to content
Snippets Groups Projects
Commit c2856e57 authored by g0dil's avatar g0dil
Browse files

Socket: Move shutdown from SocketProtocol::close() to INetSocketProtocol::close()

parent 97014b3a
No related branches found
No related tags found
No related merge requests found
...@@ -79,7 +79,14 @@ prefix_ void senf::TCPSocketProtocol::shutdown(ShutType type) ...@@ -79,7 +79,14 @@ prefix_ void senf::TCPSocketProtocol::shutdown(ShutType type)
const const
{ {
if (::shutdown(fd(), type) < 0) if (::shutdown(fd(), type) < 0)
SENF_THROW_SYSTEM_EXCEPTION(""); SENF_THROW_SYSTEM_EXCEPTION("::shutdown()");
}
prefix_ void senf::TCPSocketProtocol::close()
const
{
shutdown(ShutRDWR);
INetSocketProtocol::close();
} }
prefix_ unsigned senf::TCPSocketProtocol::available() prefix_ unsigned senf::TCPSocketProtocol::available()
......
...@@ -66,6 +66,7 @@ namespace senf { ...@@ -66,6 +66,7 @@ namespace senf {
///\name Abstract Interface Implementation ///\name Abstract Interface Implementation
///@{ ///@{
void close() const;
unsigned available() const; unsigned available() const;
bool eof() const; bool eof() const;
......
...@@ -37,8 +37,6 @@ ...@@ -37,8 +37,6 @@
prefix_ void senf::SocketProtocol::close() prefix_ void senf::SocketProtocol::close()
const const
{ {
if (::shutdown(body().fd(),SHUT_RDWR) < 0)
SENF_THROW_SYSTEM_EXCEPTION("::shutdown(socket_fd)");
if (::close(body().fd()) < 0) if (::close(body().fd()) < 0)
SENF_THROW_SYSTEM_EXCEPTION("::close(socket_fd)"); SENF_THROW_SYSTEM_EXCEPTION("::close(socket_fd)");
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment