Hi,
Is this a bug or am i doing something wrong?
i am calling net_tcp::listen with the following callback for
new_connect_cb, and when sending data from the client through the socket, i
get a ***stack smashing detected*** error.
|newConn, kill_chan| {
debug!("new conn");
task::spawn_sched (task::ManualThreads(1u), || {
debug!("this is the spawned task running");
let mut acceptRes = net_tcp::accept(newConn);
match acceptRes {
result::Ok(tcpSocket) => {
let socketBuf = net_tcp::socket_buf(tcpSocket);
debug!("accepted connection");
socketBuf.read_byte();
debug!("read byte");
socketBuf.write(str::to_bytes("yellow"));
debug!("wrote to socket");
}
result::Err(_) => error!("failed to accept socket
connection")
};
};
What couid be the problem? Thank you.
D
_______________________________________________
Rust-dev mailing list
[email protected]
https://mail.mozilla.org/listinfo/rust-dev