ConnectedUdp.hx 878 B

12345678910111213141516171819202122232425262728293031323334
  1. package eval.luv;
  2. import eval.luv.SockAddr;
  3. /**
  4. Connected UDP sockets.
  5. @see https://aantron.github.io/luv/luv/Luv/UDP/Connected
  6. **/
  7. @:forward
  8. @:using(eval.luv.Handle)
  9. abstract ConnectedUdp(Udp) to Udp to Handle {
  10. /**
  11. Removes the peer address assigned to the given socket.
  12. **/
  13. extern public function disconnect():Result<Result.NoData>;
  14. /**
  15. Retrieves the peer address assigned to the given socket.
  16. **/
  17. extern public function getPeerName():Result<SockAddr>;
  18. /**
  19. Like `eval.luv.UDP.send`, but the remote address used is the peer address
  20. assigned to the socket.
  21. **/
  22. extern public function send(data:Array<Buffer>, callback:(result:Result<Result.NoData>)->Void):Void;
  23. /**
  24. Like `eval.luv.UDP.trySend`, but the remote address used is the peer address
  25. assigned to the socket.
  26. **/
  27. extern public function trySend(data:Array<Buffer>):Result<Result.NoData>;
  28. }