diff options
author | Bartek Iwańczuk <biwanczuk@gmail.com> | 2022-10-25 22:50:55 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-10-25 22:50:55 +0200 |
commit | af62e0833dbb23ac0af674b57e5938be97ad57c8 (patch) | |
tree | 025e5004d4a605f945e74ee456cf615c2d7d7352 /ext/net/04_net_unstable.js | |
parent | 378e6a8c0369f3256cde8a595d3dbdfe4f1dc2f9 (diff) |
Revert "Revert "refactor(ext/net): clean up variadic network ops (#16… (#16422)
…392)" (#16417)"
This reverts commit 8e3f825c921b38141afa7a69a0664881c5c94461.
Diffstat (limited to 'ext/net/04_net_unstable.js')
-rw-r--r-- | ext/net/04_net_unstable.js | 60 |
1 files changed, 0 insertions, 60 deletions
diff --git a/ext/net/04_net_unstable.js b/ext/net/04_net_unstable.js deleted file mode 100644 index fcdb3c547..000000000 --- a/ext/net/04_net_unstable.js +++ /dev/null @@ -1,60 +0,0 @@ -// Copyright 2018-2022 the Deno authors. All rights reserved. MIT license. -"use strict"; - -((window) => { - const net = window.__bootstrap.net; - - function listen(options) { - if (options.transport === "unix") { - const res = net.opListen(options); - return new Listener(res.rid, res.localAddr); - } else { - return net.listen(options, Listener); - } - } - - function listenDatagram( - options, - ) { - let res; - if (options.transport === "unixpacket") { - res = net.opListen(options); - } else { - res = net.opListen({ - transport: "udp", - hostname: "127.0.0.1", - ...options, - }); - } - - return new net.Datagram(res.rid, res.localAddr); - } - - async function connect( - options, - ) { - if (options.transport === "unix") { - const res = await net.opConnect(options); - return new net.Conn(res.rid, res.remoteAddr, res.localAddr); - } else { - return net.connect(options); - } - } - - class Listener extends net.Listener { - ref() { - this[net.listenerRef](); - } - - unref() { - this[net.listenerUnref](); - } - } - - window.__bootstrap.netUnstable = { - connect, - listenDatagram, - listen, - Listener, - }; -})(this); |