Implement closeRead/closeWrite using TcpStream::shutdown#903
Merged
ry merged 5 commits intodenoland:masterfrom Oct 5, 2018
Merged
Implement closeRead/closeWrite using TcpStream::shutdown#903ry merged 5 commits intodenoland:masterfrom
ry merged 5 commits intodenoland:masterfrom
Conversation
ry
reviewed
Oct 4, 2018
ry
reviewed
Oct 4, 2018
ry
reviewed
Oct 4, 2018
| None => panic!("bad rid"), | ||
| Some(repr) => match repr { | ||
| Repr::TcpStream(ref mut f) => TcpStream::shutdown(f, how).unwrap(), | ||
| _ => panic!("Cannot shutdown"), |
ry
reviewed
Oct 5, 2018
src/resources.rs
Outdated
| assert!(r.is_some()); | ||
| } | ||
|
|
||
| // no collision with unimplemented shutdown |
ry
reviewed
Oct 5, 2018
| } | ||
| assert(!!err); | ||
| assertEqual(err.kind, deno.ErrorKind.NotConnected); | ||
| assertEqual(err.name, "NotConnected"); |
ry
reviewed
Oct 5, 2018
js/net_test.ts
Outdated
| conn.close(); | ||
| }); | ||
|
|
||
| testPerm({ net: true }, async function netConnDupCloseWriteFailure() { |
Member
There was a problem hiding this comment.
Please rename to netDoubleCloseWrite()
"dup" has special meaning in this context (see dup(2))
ry
reviewed
Oct 5, 2018
js/net_test.ts
Outdated
| conn.close(); | ||
| }); | ||
|
|
||
| testPerm({ net: true }, async function netConnDupCloseReadFailure() { |
ry
reviewed
Oct 5, 2018
js/net_test.ts
Outdated
| conn.close(); | ||
| }); | ||
|
|
||
| testPerm({ net: true }, async function netConnCloseRead() { |
ry
reviewed
Oct 5, 2018
js/net_test.ts
Outdated
| conn.close(); | ||
| }); | ||
|
|
||
| testPerm({ net: true }, async function netConnCloseWrite() { |
ry
reviewed
Oct 5, 2018
js/net.ts
Outdated
| export interface Addr { | ||
| network: Network; | ||
| address: string; | ||
| } |
Member
There was a problem hiding this comment.
Can you please leave the Addr changes out of this PR? I'd like to discuss them separately from shutdown.
ry
reviewed
Oct 5, 2018
ry
reviewed
Oct 5, 2018
ry
reviewed
Oct 5, 2018
9cb594b to
4f06636
Compare
ry
reviewed
Oct 5, 2018
| import * as deno from "deno"; | ||
| import { testPerm, assert, assertEqual, deferred } from "./test_util.ts"; | ||
| import { testPerm, assert, assertEqual } from "./test_util.ts"; | ||
| import { deferred } from "./util.ts"; |
Member
There was a problem hiding this comment.
Cool! I forgot about this when I suggested it - but this is only newly possible because of your work in #859.
js/net_test.ts runs inside of Deno, but js/util.ts runs inside of Node/rollup. But now we are able to seamlessly load util.ts in Deno too.
cc @kitsonk - can compiler_test.ts work like this too?
ry
added a commit
to ry/deno
that referenced
this pull request
Oct 12, 2018
- Add --types command line flag. - Add metrics() - Add redirect follow feature denoland#934 - Fix clearTimer bug denoland#942 - Improve error printing denoland#935 - Expose I/O interfaces Closer, Seeker, ReaderCloser, WriteCloser, ReadSeeker, WriteSeeker, ReadWriteCloser, ReadWriteSeeker - Fix silent death on double await denoland#919 - Add Conn.closeRead() and Conn.closeWrite() denoland#903
Merged
ry
added a commit
to ry/deno
that referenced
this pull request
Oct 12, 2018
- Fix promise reject issue (denoland#936) - Add --types command line flag. - Add metrics() - Add redirect follow feature denoland#934 - Fix clearTimer bug denoland#942 - Improve error printing denoland#935 - Expose I/O interfaces Closer, Seeker, ReaderCloser, WriteCloser, ReadSeeker, WriteSeeker, ReadWriteCloser, ReadWriteSeeker - Fix silent death on double await denoland#919 - Add Conn.closeRead() and Conn.closeWrite() denoland#903
ry
added a commit
that referenced
this pull request
Oct 12, 2018
- Fix promise reject issue (#936) - Add --types command line flag. - Add metrics() - Add redirect follow feature #934 - Fix clearTimer bug #942 - Improve error printing #935 - Expose I/O interfaces Closer, Seeker, ReaderCloser, WriteCloser, ReadSeeker, WriteSeeker, ReadWriteCloser, ReadWriteSeeker - Fix silent death on double await #919 - Add Conn.closeRead() and Conn.closeWrite() #903
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Attempt to implement
closeRead/closeWriteSimulated
shutdown(2)interface.Also briefly implemented
Conn.addr()