Skip to content

Commit 7cc0d9a

Browse files
author
Eric Reed
committed
---
yaml --- r: 142655 b: refs/heads/try2 c: 39a575f h: refs/heads/master i: 142653: 5d3bcba 142651: 1ad789d 142647: 3525e8f 142639: f159364 142623: b0de1fd 142591: dc0a883 v: v3
1 parent 8cb6a9a commit 7cc0d9a

File tree

2 files changed

+48
-1
lines changed

2 files changed

+48
-1
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ refs/heads/snap-stage3: 78a7676898d9f80ab540c6df5d4c9ce35bb50463
55
refs/heads/try: 519addf6277dbafccbb4159db4b710c37eaa2ec5
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
8-
refs/heads/try2: eb11274919f96331bc21702ce95e77e973d76109
8+
refs/heads/try2: 39a575fb43d2ba0511d295b7e1a9178b4919e348
99
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try2/src/libstd/rt/uv/uvll.rs

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,12 +56,14 @@ pub type uv_handle_t = c_void;
5656
pub type uv_loop_t = c_void;
5757
pub type uv_idle_t = c_void;
5858
pub type uv_tcp_t = c_void;
59+
pub type uv_udp_t = c_void;
5960
pub type uv_connect_t = c_void;
6061
pub type uv_write_t = c_void;
6162
pub type uv_async_t = c_void;
6263
pub type uv_timer_t = c_void;
6364
pub type uv_stream_t = c_void;
6465
pub type uv_fs_t = c_void;
66+
pub type uv_udp_send_t = c_void;
6567

6668
pub type uv_idle_cb = *u8;
6769

@@ -183,6 +185,40 @@ pub unsafe fn idle_stop(handle: *uv_idle_t) -> c_int {
183185
rust_uv_idle_stop(handle)
184186
}
185187

188+
pub unsafe fn udp_init(loop_handle: *uv_loop_t, handle: *uv_udp_t) -> c_int {
189+
return rust_uv_udp_init(loop_handle, handle);
190+
}
191+
192+
pub unsafe fn udp_bind(server: *uv_udp_t, addr: *sockaddr_in, flags: c_uint) -> c_int {
193+
return rust_uv_udp_bind(server, addr, flags);
194+
}
195+
196+
pub unsafe fn udp_bind6(server: *uv_udp_t, addr: *sockaddr_in6, flags: c_uint) -> c_int {
197+
return rust_uv_udp_bind6(server, addr, flags);
198+
}
199+
200+
pub unsafe fn udp_send<T>(req: *uv_udp_send_t, handle: *T, buf_in: &[uv_buf_t],
201+
addr: *sockaddr_in, cb: *u8) -> c_int {
202+
let buf_ptr = vec::raw::to_ptr(buf_in);
203+
let buf_cnt = buf_in.len() as i32;
204+
return rust_uv_udp_send(req, handle, buf_ptr, buf_cnt, addr, cb);
205+
}
206+
207+
pub unsafe fn udp_send6<T>(req: *uv_udp_send_t, handle: *T, buf_in: &[uv_buf_t],
208+
addr: *sockaddr_in6, cb: *u8) -> c_int {
209+
let buf_ptr = vec::raw::to_ptr(buf_in);
210+
let buf_cnt = buf_in.len() as i32;
211+
return rust_uv_udp_send(req, handle, buf_ptr, buf_cnt, addr, cb);
212+
}
213+
214+
pub unsafe fn udp_recv_start(server: *uv_udp_t, on_alloc: *u8, on_recv: *u8) -> c_int {
215+
return rust_uv_udp_recv_start(server, on_alloc, on_recv);
216+
}
217+
218+
pub unsafe fn udp_recv_stop(server: *uv_udp_t) -> c_int {
219+
return rust_uv_udp_recv_stop(server);
220+
}
221+
186222
pub unsafe fn tcp_init(loop_handle: *c_void, handle: *uv_tcp_t) -> c_int {
187223
return rust_uv_tcp_init(loop_handle, handle);
188224
}
@@ -417,6 +453,17 @@ extern {
417453
name: *sockaddr_in) -> c_int;
418454
fn rust_uv_tcp_getpeername6(tcp_handle_ptr: *uv_tcp_t,
419455
name: *sockaddr_in6) ->c_int;
456+
457+
fn rust_uv_udp_init(loop_handle: *uv_loop_t, handle_ptr: *uv_udp_t) -> c_int;
458+
fn rust_uv_udp_bind(server: *uv_udp_t, addr: *sockaddr_in, flags: c_uint) -> c_int;
459+
fn rust_uv_udp_bind6(server: *uv_udp_t, addr: *sockaddr_in6, flags: c_uint) -> c_int;
460+
fn rust_uv_udp_send(req: *uv_udp_send_t, handle: *uv_udp_t, buf_in: *uv_buf_t,
461+
buf_cnt: c_int, addr: *sockaddr_in, cb: *u8) -> c_int;
462+
fn rust_uv_udp_send6(req: *uv_udp_send_t, handle: *uv_udp_t, buf_in: *uv_buf_t,
463+
buf_cnt: c_int, addr: *sockaddr_in6, cb: *u8) -> c_int;
464+
fn rust_uv_udp_recv_start(server: *uv_udp_t, on_alloc: *u8, on_recv: *u8) -> c_int;
465+
fn rust_uv_udp_recv_stop(server: *uv_udp_t) -> c_int;
466+
420467
fn rust_uv_listen(stream: *c_void, backlog: c_int, cb: *u8) -> c_int;
421468
fn rust_uv_accept(server: *c_void, client: *c_void) -> c_int;
422469
fn rust_uv_write(req: *c_void,

0 commit comments

Comments
 (0)