close abstract method

Future<void> close([
  1. int code,
  2. String reason
])

Cleans up local data about the socket and explicitly closes the connection to the server ensuring that the client does not attempt to automatically reconnect.

code is 1000 by default indicating normal closure and reason is null by default.

Implementation

Future<void> close([int code, String reason]);