package de.newsarea.homecockpit.connector.net;

import de.newsarea.homecockpit.connector.AbstractGeneralConnector;
import de.newsarea.homecockpit.connector.event.ValueEventListener;
import de.newsarea.homecockpit.connector.net.client.NetClient;
import de.newsarea.homecockpit.connector.net.client.kryonet.KryoNetClient;

import java.io.IOException;
import java.net.ConnectException;

public class NetGeneralConnector extends AbstractGeneralConnector<String> {

    private NetClient netClient;

    public NetGeneralConnector(NetClient netClient) {
        this.netClient = netClient;
        this.netClient.addEventListener(new ValueEventListener() {
            @Override
            public void valueReceived(String s) {
                fireEvent(s);
            }
        });
    }

    public NetGeneralConnector(String server, int port) {
        this(new KryoNetClient(server, port));
    }

    @Override
    public void open() throws ConnectException {
        try {
            netClient.open();
        } catch (Exception e) {
            throw new ConnectException(e.getMessage());
        }
    }

    @Override
    public void write(String data) throws IOException {
        netClient.write(data);
    }

    @Override
    public void close() {
        netClient.close();
    }

}

@@ -312,16 +312,73 @@
 tClient;
+%0Aimport org.slf4j.Logger;%0Aimport org.slf4j.LoggerFactory;
 %0A%0Aimport
@@ -511,16 +511,101 @@
 ing%3E %7B%0A%0A
+    private static Logger log = LoggerFactory.getLogger(NetGeneralConnector.class);%0A%0A
     priv
@@ -1308,32 +1308,69 @@
 s IOException %7B%0A
+        log.debug(%22write %7B%7D%22, data);%0A
         netClien

add debug log for write message of NetGeneralConnector.java