# Method Stdio.UDP()->set_buffer()

Method set_buffer

  ``void` set_buffer(`int` `bufsize`, `string` `mode`)`
  ``void` set_buffer(`int` `bufsize`)`

Description

  Set internal socket buffer.

  This function sets the internal buffer size of a socket or stream.

  The second argument allows you to set the read or write buffer by specifying `"r"` or `"w"`.

Note

  It is not guaranteed that this function actually does anything, but it certainly helps to increase data transfer speed when it does.

See also

  `open_socket()`, `accept()`