rust/src/test/run-pass/sio-client.rs
Brian Anderson 4178e52c8f XFAIL all the sio tests
They have random failures still, sadly.
2011-08-05 11:57:06 -07:00

26 lines
575 B
Rust

// xfail-stage1
// xfail-stage2
// xfail-stage3
use std;
import std::sio;
import std::task;
fn connectTask(cx: sio::ctx, ip: str, portnum: int) {
let client: sio::client;
client = sio::connect_to(cx, ip, portnum);
sio::close_client(client);
}
fn main() {
let cx: sio::ctx = sio::new();
let srv: sio::server = sio::create_server(cx, "0.0.0.0", 9090);
let child: task = spawn connectTask(cx, "127.0.0.1", 9090);
let client: sio::client = sio::accept_from(srv);
task::join(child);
sio::close_client(client);
sio::close_server(srv);
sio::destroy(cx);
}