public ConnectionHandler(string ipAddress, SKMSteckbrief steckbrief = default, byte skmType = 0, PacketDispatcher dispatcher = null, ISendClient sendClient = null, IReceiveClient receiveClient = null)
        {
            Steckbrief = steckbrief;
            SKMType    = skmType;
            consoleIp  = IPAddress.Parse(ipAddress);

            this.sendClient          = sendClient ?? new SendClient();
            this.sendClient.Receive  = SendClientReceive;
            this.sendClient.Errored += SendClientErrored;
            this.sendClient.Start(new IPEndPoint(consoleIp, 5063));

            this.receiveClient          = receiveClient ?? new ReceiveClient();
            this.receiveClient.Receive  = ReceiveClientReceive;
            this.receiveClient.Errored += ReceiveClientErrored;
            this.receiveClient.Start(new IPEndPoint(IPAddress.Any, 0));

            packetDispatcher = dispatcher ?? new PacketDispatcher(this);

            completionQueue = new Queue <TaskCompletionSource <Enums.FehlerT> >();
            LocalIpBytes    = GetLocalIpAddress();
        }
 public void OnPacketReceived(PacketDispatcher sender, PacketReceivedEventArgs args)
 {
     PacketReceived?.Invoke(sender, args);
 }