The write routine

Combined from primary sources listed below.

In class IO::Handle ( type/IO/Handle )§

See primary docmentation in context for method write.

method write§

method write(IO::Handle:D: Blob:D $buf --> True)

Writes $buf to the filehandle. This method can be called even when the handle is not in binary mode.

In role IO::Socket ( type/IO/Socket )§

See primary docmentation in context for method write.

method write§

method write(IO::Socket:D: Blob:D $buf)

Writes the supplied buffer to the socket, thus sending it to other end of the connection. The string version is method print.

Fails if the socket is not connected.

In class IO::Socket::Async ( type/IO/Socket/Async )§

See primary docmentation in context for method write.

method write§

method write(IO::Socket::Async:D: Blob $b --> Promise)

This method will attempt to send the bytes in $b on the IO::Socket::Async that will have been obtained indirectly via connect or listen, returning a Promise that will be kept with the number of bytes sent or broken if there was an error sending.

In class IO::Socket::Async ( type/IO/Socket/Async )§

See primary docmentation in context for method write.

method write-to§

method write-to(IO::Socket::Async:D: Str() $host, Int() $port, Blob $b --> Promise)

This is the equivalent of write for UDP sockets that have been created with the udp method. It will try send a UDP message comprised of the bytes in the Blob $b to the specified $host and $port returning a Promise that will be kept when the data is successfully sent or broken if it was unable to send the data. In order to send to a broadcast address the :broadcast flag must have been specified when the socket was created.