interface
SocketHandler
interface SocketHandler<Data = unknown, DataBinaryType extends BinaryType = 'buffer'>
- ): void | Promise<void>;
Called when the socket fails to be created.
The promise returned by
Bun.connectrejects after this function is called.When
connectErroris specified, the rejected promise is not added to the promise rejection queue (so it isn't reported as an unhandled promise rejection, sinceconnectErrorhandles it).When
connectErroris not specified, the rejected promise is added to the promise rejection queue. - success: boolean,): void;
Called when the TLS handshake completes.
@param successWhether the server authorized the connection despite
authorizationError@param authorizationErrorThe certificate authorization error, or
nullif there was none