I am using SRWebSocket/SocketRocket library in my app I am unable to set response timeout for it . I want to show a message if socket does not receive any data after few seconds
Following is my code
var url = URL(string: streamUrl)!
socketRocket = SRWebSocket(url: URL(string: streamUrl)!)
socketRocket?.delegate = self
socketRocket?.open()
Using following callback methods as well
func webSocketDidOpen(_ webSocket: SRWebSocket!) {
print("webSocketDidOpen")
showTableView()
}
func webSocket(_ webSocket: SRWebSocket!, didCloseWithCode code: Int, reason: String!, wasClean: Bool) {
getConversationId()
}
func webSocket(_ webSocket: SRWebSocket!, didFailWithError error: Error!) {
print("didFailWithError\(error)")
showLErrorView()
}
func webSocket(_ webSocket: SRWebSocket!, didReceiveMessage message: Any!) {
}
from IOS swift Web Socket SRWebSocket set response timeout
No comments:
Post a Comment