Comments (2)
In general, it seems you are not allowed to call write
while a flush
is in progress.
Here you are not awaiting the flush
, so the following write happens while the flust is in progress:
// socket.write('Hello');
// socket.flush();
// socket.write('Goodbye');
Here you are scheduling a write to happen later, then calling flush
, which means the former write happens
while the flust is in progress.
// scheduleMicrotask(() => socket.write('Hello'));
// await socket.flush();
// scheduleMicrotask(() => socket.write('Goodbye'));
So at least it's consistent. I agree that it's not documented behavior.
from sdk.
It's deliberate that I'm not awaiting flush. If multiple chunks of async code is using the same socket, awaiting a flush isn't always possible. Sure you can await it, but code in a different location might try to write at the same instance.
And these two examples are just the ones I was able to conjure up, I've seen more weird crashes in our production environment.
Basically it feels very unsafe, to call either write or flush.
from sdk.
Related Issues (20)
- [breaking change] Compute closures of type schemas in the upper bound computations in the CFE as specified HOT 2
- Assists for adding and maybe removing digit separators from number literals
- [breaking change] Mark `IOOverrides` as `base` HOT 3
- Check if current is available within Iterator without moving the iterator HOT 1
- A directory which is "excluded" via analysis options should not be searched for other analysis options. HOT 1
- Missing unnecessary `!` warning with nested extension types HOT 6
- Exception from yaml parsing during dart fix HOT 1
- http library throws `HttpException: Connection closed before full header was received` without a stack trace HOT 4
- [analyzer_plugin]: setContextRoots event never received HOT 1
- DateTime parse function is too generic HOT 3
- `augmented()` in generative constructors needs additional compile-time checks
- Macro with explicit "dart:core" import doesn't work HOT 2
- Not able to close/release RawDatagramSocket after receiving a SocketException in Windows Desktop HOT 2
- Weird error: The argument type 'Object' can't be assigned to the parameter type 'Object'. HOT 4
- ZLibDecoder regression in 3.5.0 HOT 5
- [DDC] Performance regressions related to new generic class representation
- [dart2wasm] Extremely large const data collections emit functions that exceed maximum function size in wasm HOT 1
- Add @Since annotations to JS APIs added in 3.6 HOT 1
- Incorrect dead code removal quick fix when multiple cases share a body HOT 1
- [CP] Revert "analyzer: separate unused_element_parameter from unused_element" HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sdk.