You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
letcommand=SWIMNIOWriteCommand(message: message, to:self.swimNode, replyTimeout: timeout.toNIO, replyCallback:{ reply in
44
+
letcommand=SWIMNIOWriteCommand(message: message, to:self.swimNode, replyTimeout: timeout.toNIO){ reply in
45
45
switch reply {
46
-
case.success(.response(.nack(_, _))):
46
+
case.success(.nack(_, _)):
47
47
continuation.resume(throwing:SWIMNIOIllegalMessageTypeError("Unexpected .nack reply to .ping message! Was: \(reply)"))
48
-
49
-
case.success(.response(let pingResponse)):
48
+
49
+
case.success(let pingResponse):
50
50
assert(sequenceNumber == pingResponse.sequenceNumber,"callback invoked with not matching sequence number! Submitted with \(sequenceNumber) but invoked with \(pingResponse.sequenceNumber)!")
51
51
continuation.resume(returning: pingResponse)
52
-
52
+
53
53
case.failure(let error):
54
54
continuation.resume(throwing: error)
55
-
56
-
case.success(let other):
57
-
continuation.resume(throwing:
58
-
SWIMNIOIllegalMessageTypeError("Unexpected message, got: [\(other)]:\(reflecting:type(of: other)) while expected \(PingResponse<SWIM.NIOPeer,SWIM.NIOPeer>.self)"))
letcommand=SWIMNIOWriteCommand(message: message, to:self.node, replyTimeout: timeout.toNIO, replyCallback:{ reply in
71
+
letcommand=SWIMNIOWriteCommand(message: message, to:self.node, replyTimeout: timeout.toNIO){ reply in
76
72
switch reply {
77
-
case.success(.response(let pingResponse)):
73
+
case.success(let pingResponse):
78
74
assert(sequenceNumber == pingResponse.sequenceNumber,"callback invoked with not matching sequence number! Submitted with \(sequenceNumber) but invoked with \(pingResponse.sequenceNumber)!")
79
75
continuation.resume(returning: pingResponse)
80
76
81
77
case.failure(let error):
82
78
continuation.resume(throwing: error)
83
-
84
-
case.success(let other):
85
-
continuation.resume(throwing:SWIMNIOIllegalMessageTypeError("Unexpected message, got: \(other) while expected \(PingResponse<SWIM.NIOPeer,SWIM.NIOPeer>.self)"))
publicinit(message:SWIM.Message, to recipient:Node, replyTimeout:TimeAmount, replyCallback:(@Sendable(Result<SWIM.Message,Error>)->Void)?){
233
+
publicinit(message:SWIM.Message, to recipient:Node, replyTimeout:TimeAmount, replyCallback:(@Sendable(Result<SWIM.PingResponse<SWIM.NIOPeer,SWIM.NIOPeer>,Error>)->Void)?){
262
234
self.message = message
263
235
self.recipient =try!.init(ipAddress: recipient.host, port: recipient.port) // try!-safe since the host/port is always safe
self.log.debug("Failed to pingRequest via \(directive.requestDetails.count) peers", metadata:["pingRequest/target":"\(target)","error":"\(error)"])
456
-
self.receivePingRequestResponse(result:.timeout(target: target, pingRequestOrigin:nil, timeout: pingTimeout, sequenceNumber:0), pingedPeer: target) // sequence number does not matter
0 commit comments