package com.github.noxan.aves.server;

import java.io.IOException;
import java.net.InetSocketAddress;
import java.net.ServerSocket;

public class SocketServer implements Server, Runnable {
    private String host;
    private int port;

    private ServerSocket server;

    public SocketServer() {
	this.host = "0.0.0.0";
	this.port = 1666;
    }

    public SocketServer(String host, int port) {
	this.host = host;
	this.port = port;
    }

    @Override
    public void start() {
	try {
	    server = new ServerSocket();
	    server.bind(new InetSocketAddress(host, port));
	} catch (IOException e) {
	    e.printStackTrace();
	}
    }

    @Override
    public void run() {
    }

    @Override
    public String getHost() {
	return host;
    }

    @Override
    public int getPort() {
	return port;
    }
}

@@ -124,16 +124,40 @@
 rSocket;
+%0Aimport java.net.Socket;
 %0A%0Apublic
@@ -695,16 +695,142 @@
 run() %7B%0A
+%09while (true) %7B%0A%09    try %7B%0A%09%09Socket socket = server.accept();%0A%09    %7D catch (IOException e) %7B%0A%09%09e.printStackTrace();%0A%09    %7D%0A%09%7D%0A
     %7D%0A%0A 

add endless loop to run in socketserver and accept connections