Rust 程序设计语言 简体中文版 1.85.0Vec, sender: mpsc::Sender , } struct Job; impl ThreadPool { // --snip-- pub fn new(size: usize) -> ThreadPool { assert!(size > 0); let (sender, receiver) = mpsc::channel(); in 0..size { workers.push(Worker::new(id)); } ThreadPool { workers, sender } } // --snip-- } 示例 21-16: 修改 ThreadPool 来储存一个传输 Job 实例的发送者 在 ThreadPool::new 中,新建了一个 // --snip-- pub fn new(size: usize) -> ThreadPool { assert!(size > 0); let (sender, receiver) = mpsc::channel(); let mut workers = Vec::with_capacity(size); for id 0 码力 | 562 页 | 3.23 MB | 27 天前3
julia 1.10.10transmit data over UDP multicast, simply send to the socket. Notice that it is not necessary for a sender to join the multicast group. using Sockets group = ip"228.5.6.7" socket = Sockets.UDPSocket() ket, group) println(String(recv(socket))) leave_multicast_group(socket, group) close(socket) Sender: using Sockets group = Sockets.IPv6("ff05::5:6:7") socket = Sockets.UDPSocket() send(socket,0 码力 | 1692 页 | 6.34 MB | 3 月前3
Julia 1.10.9transmit data over UDP multicast, simply send to the socket. Notice that it is not necessary for a sender to join the multicast group. using Sockets group = ip"228.5.6.7" socket = Sockets.UDPSocket() ket, group) println(String(recv(socket))) leave_multicast_group(socket, group) close(socket) Sender: using Sockets group = Sockets.IPv6("ff05::5:6:7") socket = Sockets.UDPSocket() send(socket,0 码力 | 1692 页 | 6.34 MB | 3 月前3
Julia 1.11.4transmit data over UDP multicast, simply send to the socket. Notice that it is not necessary for a sender to join the multicast group. using Sockets group = ip"228.5.6.7" socket = Sockets.UDPSocket()CHAPTER ket, group) println(String(recv(socket))) leave_multicast_group(socket, group) close(socket) Sender: using Sockets group = Sockets.IPv6("ff05::5:6:7") socket = Sockets.UDPSocket() send(socket,0 码力 | 2007 页 | 6.73 MB | 3 月前3
Julia 1.11.5 Documentationtransmit data over UDP multicast, simply send to the socket. Notice that it is not necessary for a sender to join the multicast group. using Sockets group = ip"228.5.6.7" socket = Sockets.UDPSocket()CHAPTER ket, group) println(String(recv(socket))) leave_multicast_group(socket, group) close(socket) Sender: using Sockets group = Sockets.IPv6("ff05::5:6:7") socket = Sockets.UDPSocket() send(socket,0 码力 | 2007 页 | 6.73 MB | 3 月前3
Julia 1.11.6 Release Notestransmit data over UDP multicast, simply send to the socket. Notice that it is not necessary for a sender to join the multicast group. using Sockets group = ip"228.5.6.7" socket = Sockets.UDPSocket()CHAPTER ket, group) println(String(recv(socket))) leave_multicast_group(socket, group) close(socket) Sender: using Sockets group = Sockets.IPv6("ff05::5:6:7") socket = Sockets.UDPSocket() send(socket,0 码力 | 2007 页 | 6.73 MB | 3 月前3
julia 1.13.0 DEVtransmit data over UDP multicast, simply send to the socket. Notice that it is not necessary for a sender to join the multicast group. using Sockets group = ip"228.5.6.7" socket = Sockets.UDPSocket()CHAPTER ket, group) println(String(recv(socket))) leave_multicast_group(socket, group) close(socket) Sender: using Sockets group = Sockets.IPv6("ff05::5:6:7") socket = Sockets.UDPSocket() send(socket,0 码力 | 2058 页 | 7.45 MB | 3 月前3
Julia 1.12.0 RC1transmit data over UDP multicast, simply send to the socket. Notice that it is not necessary for a sender to join the multicast group. using Sockets group = ip"228.5.6.7" socket = Sockets.UDPSocket()CHAPTER ket, group) println(String(recv(socket))) leave_multicast_group(socket, group) close(socket) Sender: using Sockets group = Sockets.IPv6("ff05::5:6:7") socket = Sockets.UDPSocket() send(socket,0 码力 | 2057 页 | 7.44 MB | 3 月前3
Julia 1.12.0 Beta4transmit data over UDP multicast, simply send to the socket. Notice that it is not necessary for a sender to join the multicast group. using Sockets group = ip"228.5.6.7" socket = Sockets.UDPSocket()CHAPTER ket, group) println(String(recv(socket))) leave_multicast_group(socket, group) close(socket) Sender: using Sockets group = Sockets.IPv6("ff05::5:6:7") socket = Sockets.UDPSocket() send(socket,0 码力 | 2057 页 | 7.44 MB | 3 月前3
Julia 1.12.0 Beta3transmit data over UDP multicast, simply send to the socket. Notice that it is not necessary for a sender to join the multicast group. using Sockets group = ip"228.5.6.7" socket = Sockets.UDPSocket()CHAPTER ket, group) println(String(recv(socket))) leave_multicast_group(socket, group) close(socket) Sender: using Sockets group = Sockets.IPv6("ff05::5:6:7") socket = Sockets.UDPSocket() send(socket,0 码力 | 2057 页 | 7.44 MB | 3 月前3
共 11 条
- 1
- 2













