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); }