emitError method
Reports error on the socket, as a transport-level failure would.
Implementation
void emitError(Object error, [StackTrace? stackTrace]) {
if (_incoming.isClosed) return;
_incoming.addError(error, stackTrace ?? StackTrace.current);
}