Skip to content
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

TCP server fails to start listening on windows #5892

Closed
Seldaek opened this issue Apr 15, 2013 · 11 comments
Closed

TCP server fails to start listening on windows #5892

Seldaek opened this issue Apr 15, 2013 · 11 comments
Labels
O-windows Operating system: Windows

Comments

@Seldaek
Copy link
Contributor

Seldaek commented Apr 15, 2013

Using the following code in windows7 with rustc 0.6, I get:

rustc test.rs && test.exe
Started

And it stays like that forever. It's impossible to telnet to 6380 too.

extern mod std;
use std::net::tcp;
use std::net::ip;
use std::uv;

fn main() {
    io::println("Started");
    let iotask = &uv::global_loop::get();

    do tcp::listen(ip::v4::parse_addr("127.0.0.1"), 6380, 1000, iotask,
        |_kill_ch| {
            io::println("Server is listening");
        }
    ) |_new_conn, _kill_ch| {
        io::println("New client");
    };
}

I am quite new to Rust so if there is any more info I can provide please let me know.

@ghost
Copy link

ghost commented Apr 17, 2013

I can confirm that the above behaviour is the same on my machine running Win8 + rust 0.6 release

@Seldaek
Copy link
Contributor Author

Seldaek commented Apr 17, 2013

Confirming it works on ubuntu with rust 0.6, so it does indeed seem to be a windows bug.

@ramonsnir
Copy link

Aha! Reached the same conclusion on Windows Server 2012 with Rust 0.6, found this via Google.

@graydon
Copy link
Contributor

graydon commented Jul 18, 2013

Much as I hate to close things with the CADT style "not going to fix because we're rewriting this" sort of comment, the fact is we are rewriting the entire IO library. We can keep this open in the meantime to check that "TCP servers don't deadlock on windows" once that's active, but the exact code-as-written here is not going to ever work. It'll be something a bit different in the new APIs.

@graydon
Copy link
Contributor

graydon commented Jul 18, 2013

May as well nominate for production ready while we're at it. Clearly we should, y'know, support TCP servers on windows.

@Seldaek
Copy link
Contributor Author

Seldaek commented Jul 18, 2013

I'll for sure try it again when new io lands (well most likely when 0.8 does) once I updated my code base. Will try to keep this issue in mind.

@graydon
Copy link
Contributor

graydon commented Aug 22, 2013

just a bug, removing milestone/nomination.

@graydon
Copy link
Contributor

graydon commented Aug 22, 2013

New io is landed now, can you confirm TCP now works on windows?

@catamorphism
Copy link
Contributor

@Seldaek , @brson , or someone else with access to a Windows machine -- can you confirm that this issue is resolved? Thanks!

@alexcrichton
Copy link
Member

We have a fair number of tests in libstd and librustuv which are testing this functionatliy, both of which are running on windows bots right now. This code has long since changed so I'm gonna close this for old code and tests are currently running.

@Seldaek
Copy link
Contributor Author

Seldaek commented Nov 12, 2013

Agreed. I don't have a windows machine to test with anyway at the moment, but I'm sure it's fixed or failing differently by now :)

flip1995 pushed a commit to flip1995/rust that referenced this issue Aug 28, 2020
unnecessary-mut-passed: make lint message say if fn is a function or a method

changelog: refine "unnecessary-mut-passed" lint message
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
O-windows Operating system: Windows
Projects
None yet
Development

No branches or pull requests

5 participants