timeout method

Socket timeout(
  1. int timeout
)

Sets a modifier for a subsequent event emission that the callback will be called with an error when the given number of milliseconds have elapsed without an acknowledgement from the server:

@example socket.timeout(5000).emit("my-event", (err) => { if (err) { // the server did not acknowledge the event in the given delay } });

@returns self

Implementation

Socket timeout(int timeout) {
  flags['timeout'] = timeout;
  return this;
}