Package core.transmission

Examples of core.transmission.WorldOutputStream


    int port = Integer.parseInt(Settings.getSetting("client_port"));

    Output.p("I am trying to connect to " + host + ":" + port);

    this.sock = new Socket(host, port);
    this.out = new WorldOutputStream(sock);
    this.in = new WorldInputStream(sock);

    Output.p("I am connected to server");

    Output.p("Sending Handshake");
View Full Code Here


  }
 
  private static WorldOutputStream getOutput() throws UnknownHostException, IOException, InterruptedException, HandshakeException {
    if (Wrapper.wos == null) {
      Socket s = Wrapper.getSocketInstance();
      Wrapper.wos = new WorldOutputStream(s);
    }
   
    return Wrapper.wos;
  }
View Full Code Here

  public static void register() throws UnknownHostException, IOException, InterruptedException, HandshakeException {
    Wrapper.sema.acquire();
   
    Output.p("Registering PC");
   
    WorldOutputStream os = Wrapper.getOutput();

    // Sending request
    os.writeCommand(TransmissionConstants.COMMAND_REGISTER_ONLINE_PC);
    os.writeClientId(Settings.getSetting("clientid"));
   
    Wrapper.sema.release();
  }
View Full Code Here

  public static PC getOnlinePc() throws UnknownHostException, IOException, InterruptedException, ClassNotFoundException, HandshakeException {   
    Wrapper.sema.acquire();
   
    Output.p("Fetching online PC");
   
    WorldOutputStream os = Wrapper.getOutput();
    WorldInputStream is = Wrapper.getInput();

    // Sending request
    Output.p("Sending request");
    os.writeCommand(TransmissionConstants.COMMAND_GET_ONLINE_PC);

    // Retrieving response
    Output.p("Retrieving response");
    PC p = is.readPC();
   
View Full Code Here

TOP

Related Classes of core.transmission.WorldOutputStream

Copyright © 2018 www.massapicom. 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.