-
Notifications
You must be signed in to change notification settings - Fork 13.3k
TCP server is not working #4296
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I expect that the socket.read is happening on the same thread as the listen. Try spawning a new task for the connection using a dedicated thread using something like Likely related to #3599. |
Am 27.12.2012 19:09, schrieb Jesse Jones:
Thanks, that indeed works, BUT, starting a new native thread for each Best, Michael |
I think this is a dupe of #3599. |
This is a copy of rust-lang#4296 with these changes: * file is not reopened again to find if the file is generated * first five lines are scanned for `@generated` marker instead of one * no attempt is made to only search for marker in comments `@generated` marker is used by certain tools to understand that the file is generated, so it should be treated differently than a file written by a human: * linters should not be invoked on these files, * diffs in these files are less important, * and these files should not be reformatted. This PR proposes builtin support for `@generated` marker. I have not found a standard for a generated file marker, but: * Facebook [uses `@generated` marker](https://tinyurl.com/fb-generated) * Phabricator tool which was spawned from Facebook internal tool [also understands `@generated` marker](https://git.io/JnVHa) * Cargo inserts `@generated` marker into [generated Cargo.lock files](https://git.io/JnVHP) My personal story is that rust-protobuf project which I maintain was broken twice because of incompatibilities/bugs in rustfmt marker handling: [one](stepancheg/rust-protobuf#493), [two](stepancheg/rust-protobuf#551). (Also, rust-protobuf started generating `@generated` marker [6 years ago](https://git.io/JnV5h)). While rustfmt AST markers are useful to apply to a certain AST elements, disable whole-file-at-once all-tools-at-once text level marker might be easier to use and more reliable for generated code.
I am trying to write a very simple TCP server (code given below), which just reads from a
socket, but somehow the read() blocks forever. Any idea what I am doing wrong?
I also tried to create a task for each new incoming connection, but the same happens.
I actually found this example on the internet...
When I do "wget http://127.0.0.1:4000/" it prints
and then it blocks forever. I also cannot create new connections at this point.
Best,
Michael
The text was updated successfully, but these errors were encountered: