Skip to content

Instantly share code, notes, and snippets.

@tupshin
Created September 27, 2012 22:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tupshin/3796902 to your computer and use it in GitHub Desktop.
Save tupshin/3796902 to your computer and use it in GitHub Desktop.
extern mod std;
use std::net::tcp::connect;
use std::net::ip::v4::parse_addr;
use std::uv::global_loop;
fn main() {
let port:uint = 80;
let iotask = global_loop::get();
let ip = parse_addr("127.0.0.1");
let connection = connect(ip, port, iotask);
let is_ok = connection.is_ok();
io::println(is_ok.to_str());
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment