File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -62,15 +62,19 @@ extension SocketEngineWebsocket {
62
62
/// - parameter completion: Callback called on transport write completion.
63
63
public func sendWebSocketMessage( _ str: String ,
64
64
withType type: SocketEnginePacketType ,
65
- withData datas : [ Data ] ,
65
+ withData data : [ Data ] ,
66
66
completion: ( ( ) -> ( ) ) ?
67
67
) {
68
68
DefaultSocketLogger . Logger. log ( " Sending ws: \( str) as type: \( type. rawValue) " , type: " SocketEngineWebSocket " )
69
69
70
70
ws? . write ( string: " \( type. rawValue) \( str) " )
71
71
72
- for data in datas {
73
- if case let . left( bin) = createBinaryDataForSend ( using: data) {
72
+ if data. count == 0 {
73
+ completion ? ( )
74
+ }
75
+
76
+ for item in data {
77
+ if case let . left( bin) = createBinaryDataForSend ( using: item) {
74
78
ws? . write ( data: bin, completion: completion)
75
79
}
76
80
}
You can’t perform that action at this time.
0 commit comments