Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
C
capnproto
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
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
capnproto
Commits
24f4e735
Unverified
Commit
24f4e735
authored
Nov 08, 2019
by
Kenton Varda
Committed by
GitHub
Nov 08, 2019
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #908 from capnproto/connection-receiver-getsockname
Add getsockname() to ConnectionReceiver.
parents
0d7c955b
9e625f7e
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
14 additions
and
0 deletions
+14
-0
async-io-unix.c++
c++/src/kj/async-io-unix.c++
+5
-0
async-io-win32.c++
c++/src/kj/async-io-win32.c++
+5
-0
async-io.c++
c++/src/kj/async-io.c++
+3
-0
async-io.h
c++/src/kj/async-io.h
+1
-0
No files found.
c++/src/kj/async-io-unix.c++
View file @
24f4e735
...
@@ -1135,6 +1135,11 @@ public:
...
@@ -1135,6 +1135,11 @@ public:
void
setsockopt
(
int
level
,
int
option
,
const
void
*
value
,
uint
length
)
override
{
void
setsockopt
(
int
level
,
int
option
,
const
void
*
value
,
uint
length
)
override
{
KJ_SYSCALL
(
::
setsockopt
(
fd
,
level
,
option
,
value
,
length
));
KJ_SYSCALL
(
::
setsockopt
(
fd
,
level
,
option
,
value
,
length
));
}
}
void
getsockname
(
struct
sockaddr
*
addr
,
uint
*
length
)
override
{
socklen_t
socklen
=
*
length
;
KJ_SYSCALL
(
::
getsockname
(
fd
,
addr
,
&
socklen
));
*
length
=
socklen
;
}
public
:
public
:
UnixEventPort
&
eventPort
;
UnixEventPort
&
eventPort
;
...
...
c++/src/kj/async-io-win32.c++
View file @
24f4e735
...
@@ -955,6 +955,11 @@ public:
...
@@ -955,6 +955,11 @@ public:
KJ_WINSOCK
(
::
setsockopt
(
fd
,
level
,
option
,
KJ_WINSOCK
(
::
setsockopt
(
fd
,
level
,
option
,
reinterpret_cast
<
const
char
*>
(
value
),
length
));
reinterpret_cast
<
const
char
*>
(
value
),
length
));
}
}
void
getsockname
(
struct
sockaddr
*
addr
,
uint
*
length
)
override
{
socklen_t
socklen
=
*
length
;
KJ_WINSOCK
(
::
getsockname
(
fd
,
addr
,
&
socklen
));
*
length
=
socklen
;
}
public
:
public
:
Win32EventPort
&
eventPort
;
Win32EventPort
&
eventPort
;
...
...
c++/src/kj/async-io.c++
View file @
24f4e735
...
@@ -1939,6 +1939,9 @@ void ConnectionReceiver::getsockopt(int level, int option, void* value, uint* le
...
@@ -1939,6 +1939,9 @@ void ConnectionReceiver::getsockopt(int level, int option, void* value, uint* le
void
ConnectionReceiver
::
setsockopt
(
int
level
,
int
option
,
const
void
*
value
,
uint
length
)
{
void
ConnectionReceiver
::
setsockopt
(
int
level
,
int
option
,
const
void
*
value
,
uint
length
)
{
KJ_UNIMPLEMENTED
(
"Not a socket."
);
KJ_UNIMPLEMENTED
(
"Not a socket."
);
}
}
void
ConnectionReceiver
::
getsockname
(
struct
sockaddr
*
addr
,
uint
*
length
)
{
KJ_UNIMPLEMENTED
(
"Not a socket."
);
}
void
DatagramPort
::
getsockopt
(
int
level
,
int
option
,
void
*
value
,
uint
*
length
)
{
void
DatagramPort
::
getsockopt
(
int
level
,
int
option
,
void
*
value
,
uint
*
length
)
{
KJ_UNIMPLEMENTED
(
"Not a socket."
);
KJ_UNIMPLEMENTED
(
"Not a socket."
);
}
}
...
...
c++/src/kj/async-io.h
View file @
24f4e735
...
@@ -295,6 +295,7 @@ public:
...
@@ -295,6 +295,7 @@ public:
virtual
void
getsockopt
(
int
level
,
int
option
,
void
*
value
,
uint
*
length
);
virtual
void
getsockopt
(
int
level
,
int
option
,
void
*
value
,
uint
*
length
);
virtual
void
setsockopt
(
int
level
,
int
option
,
const
void
*
value
,
uint
length
);
virtual
void
setsockopt
(
int
level
,
int
option
,
const
void
*
value
,
uint
length
);
virtual
void
getsockname
(
struct
sockaddr
*
addr
,
uint
*
length
);
// Same as the methods of AsyncIoStream.
// Same as the methods of AsyncIoStream.
};
};
...
...
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