Skip to content

Commit

Permalink
Exposed a method to ping
Browse files Browse the repository at this point in the history
  • Loading branch information
Kevin Delannoy committed Feb 12, 2019
1 parent 46b167e commit 807e268
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion Sources/ApolloWebSocket/WebSocketTransport.swift
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,11 @@ public class WebSocketTransport: NetworkTransport, WebSocketDelegate {
public func isConnected() -> Bool {
return websocket.isConnected
}


public func ping(data: Data, completionHandler: (() -> Void)? = nil) {
return websocket.write(ping: data, completion: completionHandler)
}

private func processMessage(socket: WebSocketClient, text: String) {
OperationMessage(serialized: text).parse { (type, id, payload, error) in
guard let type = type, let messageType = OperationMessage.Types(rawValue: type) else {
Expand Down

0 comments on commit 807e268

Please sign in to comment.