Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mpd
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Иван Мажукин
mpd
Commits
fd923d5d
Commit
fd923d5d
authored
Aug 21, 2018
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
net/SocketDescriptor: add Shutdown()
parent
ebf607ee
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
0 deletions
+28
-0
SocketDescriptor.cxx
src/net/SocketDescriptor.cxx
+22
-0
SocketDescriptor.hxx
src/net/SocketDescriptor.hxx
+6
-0
No files found.
src/net/SocketDescriptor.cxx
View file @
fd923d5d
...
...
@@ -488,3 +488,25 @@ SocketDescriptor::Write(const void *buffer, size_t length,
return
::
sendto
(
Get
(),
(
const
char
*
)
buffer
,
length
,
flags
,
address
.
GetAddress
(),
address
.
GetSize
());
}
#ifndef _WIN32
void
SocketDescriptor
::
Shutdown
()
noexcept
{
shutdown
(
Get
(),
SHUT_RDWR
);
}
void
SocketDescriptor
::
ShutdownRead
()
noexcept
{
shutdown
(
Get
(),
SHUT_RD
);
}
void
SocketDescriptor
::
ShutdownWrite
()
noexcept
{
shutdown
(
Get
(),
SHUT_WR
);
}
#endif
src/net/SocketDescriptor.hxx
View file @
fd923d5d
...
...
@@ -241,6 +241,12 @@ public:
*/
ssize_t
Write
(
const
void
*
buffer
,
size_t
length
,
SocketAddress
address
)
noexcept
;
#ifndef _WIN32
void
Shutdown
()
noexcept
;
void
ShutdownRead
()
noexcept
;
void
ShutdownWrite
()
noexcept
;
#endif
};
static_assert
(
std
::
is_trivial
<
SocketDescriptor
>::
value
,
"type is not trivial"
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment