Examples of SocketServer


Examples of cleancoderscom.socketserver.SocketServer

  public class WithClosingSocketService {
    @Before
    public void setUp() throws Exception {
      service = new ClosingSocketService();
      server = new SocketServer(port, service);
    }
View Full Code Here

Examples of cleancoderscom.socketserver.SocketServer

public class Main {

  public static void main(String[] args) throws Exception {
    TestSetup.setupContext();
    SocketServer server = new SocketServer(8080, s -> {
      try {
        String frontPage = getFrontPage();
        String response = makeResponse(frontPage);
        s.getOutputStream().write(response.getBytes());
      } catch(IOException e) {
        e.printStackTrace();
      }
    });
    server.start();
  }
View Full Code Here

Examples of cleancoderscom.socketserver.SocketServer

import java.io.OutputStream;
import java.net.Socket;

public class HelloWorld implements SocketService {
  public static void main(String[] args) throws Exception {
    SocketServer server = new SocketServer(8080, new HelloWorld());
    server.start();
  }
View Full Code Here

Examples of com.github.dreamhead.moco.SocketServer

    public void stop() {
        runner.stop();
    }

    private SocketServer createSocketServer(Iterable<? extends RunnerSetting> settings, StartArgs startArgs) {
        SocketServer socketServer = ActualSocketServer.createLogServer(startArgs.getPort());
        for (RunnerSetting setting : settings) {
            SocketServer parsedServer = socketParser.parseServer(setting.getStream(), startArgs.getPort(), toConfigs(setting));
            socketServer = mergeServer(socketServer, parsedServer);
        }

        return socketServer;
    }
View Full Code Here

Examples of com.trulytech.mantis.socket.SocketServer

    }
    // 初始化后台Scoket Server
    try {
      if (HasBackgroundSocket) {
        svc = new SocketServer(MaxProcessThread, SocketPort);
        svc.start();
      }
    } catch (Exception e) {
      logWriter.Error("background socket server initialize failure -"
          + e.toString());
View Full Code Here

Examples of edu.csusm.cs671.auction.sockets.server.SocketServer

  private volatile boolean listenning = false;


  public AuctioneerImpl (AuctioneerConfig config){

    server = new SocketServer();
    server.setPort(config.getPort());
    server.addListener(this);
    ExecutorService executor = Executors.newSingleThreadExecutor();
    executor.submit(server);
View Full Code Here

Examples of fitnesse.socketservice.SocketServer

public class SocketCatcherTest {

  @Test
  public void shouldPassIncomingConnectionToSocketAccepter() throws IOException, InterruptedException {
    SocketAccepter accepter = mock(SocketAccepter.class);
    SocketServer server = new SocketCatcher(accepter, 1);
    MockSocket socket = new MockSocket("GET /?responder=socketCatcher&ticket=1 HTTP/1.1\r\n\r\n");

    server.serve(socket);

    verify(accepter).acceptSocket(socket);
  }
View Full Code Here

Examples of org.apache.avro.ipc.SocketServer

  public TetherTaskRunner(TetherTask task) throws IOException {
    this.task = task;

    // start input server
    this.inputServer = new SocketServer
      (new SpecificResponder(InputProtocol.class, this),
       new InetSocketAddress(0));
    inputServer.start();

    // open output to parent
View Full Code Here

Examples of org.apache.avro.ipc.SocketServer

  public void testStartServer() throws Exception {
    if (server != null) return;
    Responder responder = new TestResponder();
    responder.addRPCPlugin(new RPCMetaTestPlugin("key1"));
    responder.addRPCPlugin(new RPCMetaTestPlugin("key2"));
    server = new SocketServer(responder, new InetSocketAddress(0));
    server.start();
   
    client = new SocketTransceiver(new InetSocketAddress(server.getPort()));
    requestor = new GenericRequestor(PROTOCOL, client);
    requestor.addRPCPlugin(new RPCMetaTestPlugin("key1"));
View Full Code Here

Examples of org.apache.avro.ipc.SocketServer

  protected static TestNamespace proxy;

  @Before
  public void testStartServer() throws Exception {
    if (server != null) return;
    server = new SocketServer(new SpecificResponder(TestNamespace.class, new TestImpl()),
                              new InetSocketAddress(0));
    server.start();
    client = new SocketTransceiver(new InetSocketAddress(server.getPort()));
    proxy = (TestNamespace)SpecificRequestor.getClient(TestNamespace.class, client);
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.