Liking cljdoc? Tell your friends :D

sockets.datagram.socket


-receivecljmultimethod

source

behaviourclj

source

createclj

(create)
(create arg)
(create port local-addr)

A constructor for datagram sockets. This function my take 0, 1, or two args.

  • 0-arity: Constructs a datagram socket and binds it to any available port on the local host machine.
  • 1-arity: If the argument is an instance of the DatagramSocketImpl class, Creates an unbound datagram socket with the specified DatagramSocketImpl. If the argument is an integer, it is interpreted as a port, in which case, datagram socket will be constructed and bound to the specified port on the local host machine. If the argument is an instance of SocketAddress, the constructor creates a datagram socket, bound to the specified local socket address.
  • 2-arity: Creates a datagram socket, bound to the specified port and local InetAddress.
A constructor for datagram sockets. This function my take 0, 1, or two args.

* 0-arity: Constructs a datagram socket and binds it to any available port
  on the local host machine.
* 1-arity: If the argument is an instance of the `DatagramSocketImpl` class,
  Creates an unbound datagram socket with the specified `DatagramSocketImpl`.
  If the argument is an integer, it is interpreted as a port, in which
  case, datagram socket will be constructed and bound to the specified port
  on the local host machine. If the argument is an instance of
  `SocketAddress`, the constructor creates a datagram socket, bound to the
  specified local socket address.
* 2-arity: Creates a datagram socket, bound to the specified port and local
  `InetAddress`.
sourceraw docstring

Socketcljprotocol

so-timeout!clj

(so-timeout! this timeout)

Enable/disable SO_TIMEOUT with the specified timeout, in milliseconds.

Enable/disable `SO_TIMEOUT` with the specified timeout, in milliseconds.

traffic-class!clj

(traffic-class! this class-int)

Sets traffic class or type-of-service octet in the IP datagram header for datagrams sent from this DatagramSocket.

Sets traffic class or type-of-service octet in the IP datagram header for
datagrams sent from this `DatagramSocket`.

receive-buffer-sizeclj

(receive-buffer-size this)

Get value of the SO_RCVBUF option for thisDatagramSocket, that is the buffer size used by the platform for input on thisDatagramSocket`.

Get value of the `SO_RCVBUF option for this `DatagramSocket`, that is the
buffer size used by the platform for input on this `DatagramSocket`.

bindclj

(bind this addr)

Binds this DatagramSocket to a specific address and port.

Binds this `DatagramSocket` to a specific address and port.

local-addressclj

(local-address this)

Gets the local address to which the socket is bound.

Gets the local address to which the socket is bound.

reuse-addressclj

(reuse-address this)

Tests if SO_REUSEADDR is enabled.

Tests if `SO_REUSEADDR` is enabled.

local-socket-addressclj

(local-socket-address this)

Returns the address of the endpoint this socket is bound to.

Returns the address of the endpoint this socket is bound to.

receive-buffer-size!clj

(receive-buffer-size! this size)

Sets the SO_RCVBUF option to the specified value for this DatagramSocket.

Sets the `SO_RCVBUF` option to the specified value for this
`DatagramSocket`.

bound?clj

(bound? this)

Returns the binding state of the socket.

Returns the binding state of the socket.

send-buffer-sizeclj

(send-buffer-size this)

Get value of the SO_SNDBUF option for this DatagramSocket, that is the buffer size used by the platform for output on this DatagramSocket.

Get value of the `SO_SNDBUF` option for this `DatagramSocket`, that is the
buffer size used by the platform for output on this `DatagramSocket`.

send-buffer-size!clj

(send-buffer-size! this size)

Sets the SO_SNDBUF option to the specified value for this DatagramSocket.

Sets the `SO_SNDBUF` option to the specified value for this
`DatagramSocket`.

remote-socket-addressclj

(remote-socket-address this)

Returns the address of the endpoint this socket is connected to, or null if it is unconnected.

Returns the address of the endpoint this socket is connected to, or null
if it is unconnected.

connected?clj

(connected? this)

Returns the connection state of the socket.

Returns the connection state of the socket.

local-portclj

(local-port this)

Returns the port number on the local host to which this socket is bound.

Returns the port number on the local host to which this socket is bound.

connectclj

(connect this addr)
(connect this addr port)

For the 1-arity function, connects this socket to a remote socket address (IP address + port number; must be an instance or subclass of SocketAddress). For the 2-arity function, connects the socket to a remote address amd port for this socket (the address must be an instance or subclass of InetAddress).

For the 1-arity function, connects this socket to a remote socket address
(IP address + port number; must be an instance or subclass of
`SocketAddress`). For the 2-arity function, connects the socket to a remote
address amd port for this socket (the address must be an instance or
subclass of `InetAddress`).

channelclj

(channel this)

Returns the unique DatagramChannel object associated with this datagram socket, if any.

Returns the unique `DatagramChannel` object associated with this datagram
socket, if any.

receiveclj

(receive this)
(receive this packet)

Receives a datagram packet from this socket. Additionally, the Clojure wrapper allows you to pass the packet size instead of the packet itself. If this option is exercised, a packet of the indicated size will be created and returned. Another Clojure wrapper convenience, the 1-arity version of this function, will use the default packet size DEFAULT_PACKET_SIZE and create a packet under the covers with that size.

Receives a datagram packet from this socket. Additionally, the Clojure
wrapper allows you to pass the packet size instead of the packet itself. If
this option is exercised, a packet of the indicated size will be created and
returned. Another Clojure wrapper convenience, the 1-arity version of this
function, will use the default packet size `DEFAULT_PACKET_SIZE` and create
a packet under the covers with that size.

traffic-classclj

(traffic-class this)

Gets traffic class or type-of-service in the IP datagram header for packets sent from this DatagramSocket.

Gets traffic class or type-of-service in the IP datagram header for
packets sent from this `DatagramSocket`.

portclj

(port this)

Returns the port number to which this socket is connected.

Returns the port number to which this socket is connected.

closeclj

(close this)

Closes this datagram socket.

Closes this datagram socket.

broadcast?clj

(broadcast? this)

Tests if SO_BROADCAST is enabled.

Tests if `SO_BROADCAST` is enabled.

closed?clj

(closed? this)

Returns whether the socket is closed or not.

Returns whether the socket is closed or not.

inet-addressclj

(inet-address this)

Returns the address to which this socket is connected.

Returns the address to which this socket is connected.

broadcast!clj

(broadcast! this bool)

Enable/disable SO_BROADCAST.

Enable/disable `SO_BROADCAST`.

so-timeoutclj

(so-timeout this)

Retrieve setting for SO_TIMEOUT.

Retrieve setting for `SO_TIMEOUT`.

reuse-address!clj

(reuse-address! this bool)

Enable/disable the SO_REUSEADDR socket option.

Enable/disable the `SO_REUSEADDR` socket option.

sendclj

(send this packet)

Sends a datagram packet from this socket.

Sends a datagram packet from this socket.

disconnectclj

(disconnect this)

Disconnects the socket.

Disconnects the socket.
source

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close