Created
September 27, 2012 23:39
-
-
Save tupshin/3797112 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
extern mod std; | |
use std::net::tcp::connect; | |
use std::net::tcp::write; | |
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()); | |
let socket <- connection.get(); <---- error: instantiating a type parameter with an incompatible type (needs `copy`, got `owned`, missing `copy`) | |
let data: ~[u8] = ~[7, 5, 3]; | |
// write(socket, data); | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment