2011-08-04 14:01:52 -05:00
|
|
|
// xfail-stage1
|
|
|
|
// xfail-stage2
|
|
|
|
// xfail-stage3
|
|
|
|
|
2011-06-16 00:04:31 -05:00
|
|
|
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);
|
|
|
|
}
|
|
|
|
|