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
c6f61a69
Commit
c6f61a69
authored
Oct 30, 2018
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
event/ServerSocket: make OneServerSocket an inner class
parent
0307b49f
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
8 deletions
+7
-8
ServerSocket.cxx
src/event/ServerSocket.cxx
+6
-6
ServerSocket.hxx
src/event/ServerSocket.hxx
+1
-2
No files found.
src/event/ServerSocket.cxx
View file @
c6f61a69
...
...
@@ -52,7 +52,7 @@
#include <netdb.h>
#endif
class
OneServerSocket
final
:
private
SocketMonitor
{
class
ServerSocket
::
OneServerSocket
final
:
private
SocketMonitor
{
ServerSocket
&
parent
;
const
unsigned
serial
;
...
...
@@ -146,7 +146,7 @@ get_remote_uid(int fd)
}
inline
void
OneServerSocket
::
Accept
()
noexcept
ServerSocket
::
OneServerSocket
::
Accept
()
noexcept
{
StaticSocketAddress
peer_address
;
UniqueSocketDescriptor
peer_fd
(
GetSocket
().
AcceptNonBlock
(
peer_address
));
...
...
@@ -170,14 +170,14 @@ OneServerSocket::Accept() noexcept
}
bool
OneServerSocket
::
OnSocketReady
(
gcc_unused
unsigned
flags
)
noexcept
ServerSocket
::
OneServerSocket
::
OnSocketReady
(
gcc_unused
unsigned
flags
)
noexcept
{
Accept
();
return
true
;
}
inline
void
OneServerSocket
::
Open
()
ServerSocket
::
OneServerSocket
::
Open
()
{
assert
(
!
IsDefined
());
...
...
@@ -272,7 +272,7 @@ ServerSocket::Close() noexcept
i
.
Close
();
}
OneServerSocket
&
ServerSocket
::
OneServerSocket
&
ServerSocket
::
AddAddress
(
SocketAddress
address
)
noexcept
{
sockets
.
emplace_back
(
loop
,
*
this
,
next_serial
,
...
...
@@ -281,7 +281,7 @@ ServerSocket::AddAddress(SocketAddress address) noexcept
return
sockets
.
back
();
}
OneServerSocket
&
ServerSocket
::
OneServerSocket
&
ServerSocket
::
AddAddress
(
AllocatedSocketAddress
&&
address
)
noexcept
{
sockets
.
emplace_back
(
loop
,
*
this
,
next_serial
,
...
...
src/event/ServerSocket.hxx
View file @
c6f61a69
...
...
@@ -27,13 +27,12 @@ class AllocatedSocketAddress;
class
UniqueSocketDescriptor
;
class
EventLoop
;
class
AllocatedPath
;
class
OneServerSocket
;
/**
* A socket that accepts incoming stream connections (e.g. TCP).
*/
class
ServerSocket
{
friend
class
OneServerSocket
;
class
OneServerSocket
;
EventLoop
&
loop
;
...
...
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