Connectionless datagram send/receive. Implemented by DatagramChannel.
Connectionless datagram send/receive. Implemented by DatagramChannel.
(receive! ch buf)Receives a datagram into buf.
Returns the source SocketAddress, or nil if no datagram was available
(non-blocking mode with empty receive queue).
Receives a datagram into `buf`. Returns the source SocketAddress, or nil if no datagram was available (non-blocking mode with empty receive queue).
(send! ch buf addr)Sends the bytes remaining in buf to addr (a SocketAddress).
Returns the number of bytes sent.
Sends the bytes remaining in `buf` to `addr` (a SocketAddress). Returns the number of bytes sent.
Common operations across all channel types.
Common operations across all channel types.
(close! ch)Closes the channel. Idempotent — safe to call on an already-closed channel.
Closes the channel. Idempotent — safe to call on an already-closed channel.
(open? ch)Returns true if the channel is open.
Returns true if the channel is open.
Stream-oriented reading into a ByteBuffer. Implemented by SocketChannel. Returns the number of bytes read, or -1 on end-of-stream.
Stream-oriented reading into a ByteBuffer. Implemented by SocketChannel. Returns the number of bytes read, or -1 on end-of-stream.
(read! ch buf)Reads bytes from ch into buf. Returns bytes read, or -1 on EOF.
Reads bytes from `ch` into `buf`. Returns bytes read, or -1 on EOF.
Stream-oriented writing from a ByteBuffer. Implemented by SocketChannel. Returns the number of bytes written.
Stream-oriented writing from a ByteBuffer. Implemented by SocketChannel. Returns the number of bytes written.
(write! ch buf)Writes bytes from buf to ch. Returns bytes written.
Writes bytes from `buf` to `ch`. Returns bytes written.
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |