@Override
    public void run() {
        try {
            client = new Socket(configReader.get_string("hostname"), configReader.get_int("sync_port", 1, 65536));
            BufferedInputStream inFromServer = new BufferedInputStream(client.getInputStream());
            BufferedOutputStream outToServer = new BufferedOutputStream(client.getOutputStream());

            logWriter.log(4, key, "Streams established \n");

            PacketWriter packetWriter = new PacketWriter(outToServer);
            PacketReader packetReader = new PacketReader(inFromServer);

            while (alive) {
                ioPackage = lbq.take();

                if (ioPackage.byte_address.equals("Fake")) {
                    continue;
                }
                logWriter.log(3, key, "IO_Package received.", " Device ID: ", ioPackage.byte_address, " Pin ID: ", ioPackage.pin_id, " New Value: ", Byte.toString(ioPackage.value), "\n");

                if (ioPackage.to_poll == true) {

                    polling_init(packetWriter);
                    packetWriter.flush();
                    logWriter.log(3, key, "Wrote IO_Packet with Device ID: ", ioPackage.byte_address, " to the IO Manager for Polling \n");
                } else {
                    write_package(packetWriter);                //writes a value to the ioManager
                    packetWriter.flush();
                    logWriter.log(4, key, "Wrote IO_Packet with Device ID: ", ioPackage.byte_address, " to the IO Mangager for Writing \n");
                }

                IO_Packet ioPacket = packetReader.readPacket();
                if (ioPacket.getValue() == 0) {
                    logWriter.log(0, key, "Error received from IO Manager with Device ID: ", Integer.toString(ioPacket.getGeraeteId()), "\n");
                } else {
                    logWriter.log(3, key, "Succesfully", pollOrWrite, "\n");
                }
            }

            packetWriter.close();
            packetReader.close();
            client.close();

        } catch (IOException e) {
            logWriter.log(0, key,
                    "\n\n",
                    "ERROR: \n",
                    "    Could not create Socket, is the IO Manager running?\n",
                    "DETAILED ERROR:\n",
                    "    trying to connect to host: ", configReader.get_string("hostname"),
                    "\n    on port: ", ((Integer) configReader.get_int(("sync_port"), 1, 65536)).toString(),
                    "\n    message: ", e.getMessage(), "\n\n"
            );
            Main.exit();
        } catch (NumberFormatException e) {
            logWriter.log(0, key,
                    "\n\n",
                    "ERROR: \n",
                    "    Could not create Socket, NumberFormatException occured\n",
                    "DETAILED ERROR: \n    ",
                    e.getMessage(), "\n\n"
            );
            Main.exit();
        } catch (IllegalArgumentException e) {
            logWriter.log(0, key,
                    "\n\n",
                    "ERROR: \n",
                    "    Could not create Socket, IllegalArgumentException occured\n",
                    "DETAILED ERROR: \n    ",
                    e.getMessage(), "\n\n"
            );
            Main.exit();
        } catch (Exception e) {
            logWriter.log(0, key,
                    "\n\n",
                    "ERROR: \n",
                    "    An Exception occured inside of Synchronous_IO_Worker\n",
                    "       thread, but dont know which.\n",
                    "DETAILED ERROR: \n    ",
                    e.getMessage(), "\n\n"
            );
            Main.exit();

        }
    }