Skip to content

Commit 807e268

Browse files
author
Kevin Delannoy
committed
Exposed a method to ping
1 parent 46b167e commit 807e268

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)