2012-08-15 20:34:28 -05:00
|
|
|
#[link(name="socketlib", vers="0.0")];
|
2012-08-16 16:30:14 -05:00
|
|
|
#[crate_type = "lib"];
|
2012-09-25 17:22:28 -05:00
|
|
|
#[legacy_exports];
|
2012-08-15 20:34:28 -05:00
|
|
|
|
|
|
|
mod socket {
|
2012-09-21 20:10:45 -05:00
|
|
|
#[legacy_exports];
|
2012-08-15 20:34:28 -05:00
|
|
|
|
|
|
|
export socket_handle;
|
|
|
|
|
2012-08-15 20:46:55 -05:00
|
|
|
struct socket_handle {
|
2012-09-06 21:40:15 -05:00
|
|
|
sockfd: libc::c_int,
|
2012-11-14 00:22:37 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
impl socket_handle : Drop {
|
2012-11-28 17:42:16 -06:00
|
|
|
fn finalize(&self) {
|
2012-11-14 00:22:37 -06:00
|
|
|
/* c::close(self.sockfd); */
|
|
|
|
}
|
2012-08-15 20:34:28 -05:00
|
|
|
}
|
2012-09-05 17:58:43 -05:00
|
|
|
|
|
|
|
fn socket_handle(x: libc::c_int) -> socket_handle {
|
|
|
|
socket_handle {
|
|
|
|
sockfd: x
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2012-08-15 20:34:28 -05:00
|
|
|
}
|