send_to_wait
fn send_to_wait(Stream s, Vec<byte> buf, string host, int port) -> Result<int, IoError> Import
Source: use io::sync::{send_to_wait}; src/io/sync.hy Sends buf as one UDP datagram to host:port, waiting while the socket is not ready.
Parameters#
| Name | Type |
|---|---|
s | Stream |
buf | Vec<byte> |
host | string |
port | int |
Returns#
Result<int, IoError>
See also#
write_all: Writes all ofbuftos, waiting whenever the stream is not ready.read_exact: Fills all ofbuffroms, waiting whenever no data is ready.read_to_end: Reads fromsuntil it ends and returns everything read.accept_wait: Waits for the next connection on a TCPlistenerand returns its stream.recv_from_wait: Waits for a UDP datagram, reads it intobuf, and returns(bytes, sender host, sender port).copy: Copies the filesrctodst.print: Writessto standard output, without a newline.println: Writessand a newline to standard output.