getting there

This commit is contained in:
eskimo
2024-10-03 13:45:22 -04:00
parent de6b28ab43
commit 7e77833452
8 changed files with 3657 additions and 21 deletions

View File

@@ -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)
}
}