Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
W
wendelin.core
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Joshua
wendelin.core
Commits
103b38bb
Commit
103b38bb
authored
Mar 10, 2020
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
22a93966
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
21 deletions
+22
-21
wcfs/client/wcfs_watchlink.cpp
wcfs/client/wcfs_watchlink.cpp
+22
-21
No files found.
wcfs/client/wcfs_watchlink.cpp
View file @
103b38bb
...
...
@@ -66,27 +66,6 @@ pair<WatchLink, error> WCFS::_openwatch() {
return
make_pair
(
wlink
,
nil
);
}
error
_WatchLink
::
closeWrite
()
{
_WatchLink
&
wlink
=
*
this
;
xerr
::
Contextf
E
(
"%s: closeWrite"
,
v
(
wlink
));
wlink
.
_txclose1
.
do_
([
&
]()
{
// ask wcfs to close its tx & rx sides; wcfs.close(tx) wakes up
// _serveRX on client (= on us). The connection can be already closed
// by wcfs - so ignore errors when sending bye.
(
void
)
wlink
.
_send
(
wlink
.
_nextReqID
(),
"bye"
);
// XXX vvv should be ~ shutdown(TX, wlink._f), however shutdown does
// not work for non-socket file descriptors. And even if we dup link
// fd, and close only one used for TX, peer's RX will still be blocked
// as fds are referring to one file object which stays in opened
// state. So just use ^^^ "bye" as "TX closed" message.
// wlink._wtx.close();
});
return
nil
;
}
// close closes the link.
error
_WatchLink
::
close
()
{
_WatchLink
&
wlink
=
*
this
;
...
...
@@ -112,6 +91,28 @@ error _WatchLink::close() {
return
E
(
err
);
}
// closeWrite closes send half of the link.
error
_WatchLink
::
closeWrite
()
{
_WatchLink
&
wlink
=
*
this
;
xerr
::
Contextf
E
(
"%s: closeWrite"
,
v
(
wlink
));
wlink
.
_txclose1
.
do_
([
&
]()
{
// ask wcfs to close its tx & rx sides; wcfs.close(tx) wakes up
// _serveRX on client (= on us). The connection can be already closed
// by wcfs - so ignore errors when sending bye.
(
void
)
wlink
.
_send
(
wlink
.
_nextReqID
(),
"bye"
);
// XXX vvv should be ~ shutdown(TX, wlink._f), however shutdown does
// not work for non-socket file descriptors. And even if we dup link
// fd, and close only one used for TX, peer's RX will still be blocked
// as fds are referring to one file object which stays in opened
// state. So just use ^^^ "bye" as "TX closed" message.
// wlink._wtx.close();
});
return
nil
;
}
// _serveRX receives messages from ._f and dispatches them according to streamID.
error
_WatchLink
::
_serveRX
(
context
::
Context
ctx
)
{
_WatchLink
&
wlink
=
*
this
;
...
...
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