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 {
6262 /// - parameter completion: Callback called on transport write completion.
6363 public func sendWebSocketMessage( _ str: String ,
6464 withType type: SocketEnginePacketType ,
65- withData datas : [ Data ] ,
65+ withData data : [ Data ] ,
6666 completion: ( ( ) -> ( ) ) ?
6767 ) {
6868 DefaultSocketLogger . Logger. log ( " Sending ws: \( str) as type: \( type. rawValue) " , type: " SocketEngineWebSocket " )
6969
7070 ws? . write ( string: " \( type. rawValue) \( str) " )
7171
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) {
7478 ws? . write ( data: bin, completion: completion)
7579 }
7680 }
You can’t perform that action at this time.
0 commit comments