.waiting, .preparing, .failed, .cancelled: break case .ready: let negotiateRequest = NegotiateRequest( messageId: 0, securityMode: [.signingEnabled], dialects: [.smb202, .smb210] ) let data = negotiateRequest.encoded() let transportPacket = DirectTCPPacket(smb2Message: data) let packet = transportPacket.encoded() connection.send(content: packet, completion: .contentProcessed() { (error) in connection.receive( minimumIncompleteLength: 0, maximumLength: 65536 ) { (content, contentContext, isComplete, error) in guard let content else { return } print(content.hex) } }) @unknown default: break } } let negotiateRequest = NegotiateRequest( messageId: 0, securityMode: [.signingEnabled], dialects: [.smb202, .smb210] ) let data = negotiateRequest.encoded() let transportPacket = DirectTCPPacket(smb2Message: data) let packet = transportPacket.encoded() connection.send(content: packet, completion: .contentProcessed() { (error) in connection.receive( minimumIncompleteLength: 0, maximumLength: 65536 ) { (content, contentContext, isComplete, error) in guard let content else { return } print(content.hex) } })