class SFML::Network::UdpSocket

Connectionless UDP datagram socket. Bind a port to receive, send to (address, port). Stateless β€” every send/receive specifies the peer.

sock = SFML::Network::UdpSocket.new sock.bind(port: 9999) sock.send(β€œhello”, to: SFML::Network::IpAddress::LOCALHOST, port: 9000) status, bytes, addr, port = sock.receive(max: 1024)