File tree 2 files changed +15
-5
lines changed
2 files changed +15
-5
lines changed Original file line number Diff line number Diff line change @@ -235,7 +235,7 @@ public class StompClient: WebSocketChannelDelegate {
235
235
public func send( frame: inout Frame , using encoding: String . Encoding ? = . utf8) {
236
236
237
237
// support transaction
238
- if ( transaction = = nil ) {
238
+ if ( transaction ! = nil ) {
239
239
frame. addHeader ( FrameHeader ( k: Headers . TRANSACTION. rawValue, v: transaction!. trxId) )
240
240
}
241
241
Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ import Foundation
13
13
* another Websocket library. Future versions of StompClientKit may add new Websocket libraries.
14
14
*/
15
15
public protocol WebSocketChannel : class {
16
-
16
+
17
17
/**
18
18
* Build a new channel using a Websocket URL .
19
19
*/
@@ -50,12 +50,22 @@ public protocol WebSocketChannel: class {
50
50
var delegate : WebSocketChannelDelegate { get set }
51
51
}
52
52
53
- /**
54
- *
55
- */
53
+
54
+ /// WebSocketChannelDelete
55
+ /// defines callbacks when Websocket event occoured.
56
56
public protocol WebSocketChannelDelegate {
57
+
58
+ /// Callbak after websocket channel connected
57
59
func onChannelConnected( )
60
+
61
+ /// Call back after websocket channel disconnected
58
62
func onChannelDisConnected( )
63
+
64
+ /// Text handler
65
+ /// - Parameter text: Text that received from websocket server.
59
66
func onText( received text: String )
67
+
68
+ /// Error handler
69
+ /// - Parameter error: <#error description#>
60
70
func onChannelError( _ error: Error )
61
71
}
You can’t perform that action at this time.
0 commit comments