// NativeClient.swiftfunc readMessage(){
guard let task =self.webSocketTask else{return}
task.receive{ result in
switch result {case.success(.data(let data)):self.delegate?.onMessage(connection:self, data: data)self.readMessage()default:self.disconnect()}}}func send(_ message:MessageDTO){
if let data =try?JSONEncoder().encode(message){
webSocketTask?.send(.data(data), completionHandler:{ error in
if let error = error {self.delegate?.onError(connection:self, error: error)}})}}