Skip to content

Commit

Permalink
fix #1178
Browse files Browse the repository at this point in the history
  • Loading branch information
nuclearace committed Mar 28, 2019
1 parent 148c302 commit 4468265
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions Source/SocketIO/Engine/SocketEngineWebsocket.swift
Original file line number Diff line number Diff line change
Expand Up @@ -62,15 +62,19 @@ extension SocketEngineWebsocket {
/// - parameter completion: Callback called on transport write completion.
public func sendWebSocketMessage(_ str: String,
withType type: SocketEnginePacketType,
withData datas: [Data],
withData data: [Data],
completion: (() -> ())?
) {
DefaultSocketLogger.Logger.log("Sending ws: \(str) as type: \(type.rawValue)", type: "SocketEngineWebSocket")

ws?.write(string: "\(type.rawValue)\(str)")

for data in datas {
if case let .left(bin) = createBinaryDataForSend(using: data) {
if data.count == 0 {
completion?()
}

for item in data {
if case let .left(bin) = createBinaryDataForSend(using: item) {
ws?.write(data: bin, completion: completion)
}
}
Expand Down

1 comment on commit 4468265

@peihsendoyle
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is that commit fixed the problem?

Please sign in to comment.