Skip to content

Commit d03a647

Browse files
Merge pull request #422 from delannoyk/ping
Exposed a method to ping
2 parents b5fb0a9 + 807e268 commit d03a647

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

Sources/ApolloWebSocket/WebSocketTransport.swift

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,11 @@ public class WebSocketTransport: NetworkTransport, WebSocketDelegate {
7878
public func isConnected() -> Bool {
7979
return websocket.isConnected
8080
}
81-
81+
82+
public func ping(data: Data, completionHandler: (() -> Void)? = nil) {
83+
return websocket.write(ping: data, completion: completionHandler)
84+
}
85+
8286
private func processMessage(socket: WebSocketClient, text: String) {
8387
OperationMessage(serialized: text).parse { (type, id, payload, error) in
8488
guard let type = type, let messageType = OperationMessage.Types(rawValue: type) else {

0 commit comments

Comments
 (0)