getting there
This commit is contained in:
@@ -80,7 +80,7 @@ public class Socket: NSObject {
|
||||
func receive(on connection: NWConnection) {
|
||||
connection.receive(minimumIncompleteLength: 1, maximumLength: 65536) { (data, contentContext, isComplete, error) in
|
||||
if let data = data, !data.isEmpty {
|
||||
if let message = String(data: data, encoding: .utf8)?.trimmingCharacters(in: .whitespacesAndNewlines) {
|
||||
if let message = String(data: data, encoding: .utf8) {
|
||||
self.delegate?.didReceiveMessage(socket: self.id, message: message)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user