Choose what ArrayBufferView is returned in the SocketHandler.data callback.
interface
SocketHandler
interface SocketHandler<Data = unknown, DataBinaryType extends BinaryType = 'buffer'>
- ): void | Promise<void>;
When the socket fails to be created, this function is called.
The promise returned by
Bun.connectrejects after this function is called.When
connectErroris specified, the rejected promise will not be added to the promise rejection queue (so it won't be reported as an unhandled promise rejection, since connectError handles it).When
connectErroris not specified, the rejected promise will be added to the promise rejection queue.