<commit_before>import Foundation
import CocoaAsyncSocket

final class MConnectingSocketTcpDelegate:
    NSObject,
    GCDAsyncSocketDelegate
{
    weak var model:MConnectingSocketTcp?
    
    //MARK: delegate
    
    func socket(
        _ sock:GCDAsyncSocket,
        didAcceptNewSocket newSocket:GCDAsyncSocket)
    {
        print("accepted \(sock)")
        model?.acceptedConnection(
            acceptedSocket:newSocket)
    }
    
    func socket(
        _ sock:GCDAsyncSocket,
        didRead data:Data,
        withTag tag:Int)
    {
        print("read")
        guard
            
            let string:String = String(
                data:data,
                encoding:String.Encoding.utf8)
            
        else
        {
            return
        }
        
        DispatchQueue.global(
            qos:DispatchQoS.QoSClass.background).async
        { [weak self] in
            
            self?.model?.receivedString(string:string)
        }
    }
    
    func socketDidDisconnect(_ sock: GCDAsyncSocket, withError err: Error?) {
        print("error")
        print(err)
    }
}<commit_msg>Remove prints<commit_after>import Foundation
import CocoaAsyncSocket

final class MConnectingSocketTcpDelegate:
    NSObject,
    GCDAsyncSocketDelegate
{
    weak var model:MConnectingSocketTcp?
    
    //MARK: delegate
    
    func socket(
        _ sock:GCDAsyncSocket,
        didAcceptNewSocket newSocket:GCDAsyncSocket)
    {
        model?.acceptedConnection(
            acceptedSocket:newSocket)
    }
    
    func socket(
        _ sock:GCDAsyncSocket,
        didRead data:Data,
        withTag tag:Int)
    {
        guard
            
            let string:String = String(
                data:data,
                encoding:String.Encoding.utf8)
            
        else
        {
            return
        }
        
        DispatchQueue.global(
            qos:DispatchQoS.QoSClass.background).async
        { [weak self] in
            
            self?.model?.receivedString(string:string)
        }
    }
}
{'fraction_non_alphanumeric': 0.07250608272506083, 'fraction_numerical': 0.0009732360097323601, 'mean_word_length': 1.595959595959596, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2407650', 'n_tokens_mistral': 577, 'n_tokens_neox': 563, 'n_words': 97}