Examples of MessageStream


Examples of xnap.plugin.nap.net.msg.server.MessageStream

    {
  String ip = "";
  int port = 0;

  BrowseSocket bs = null;
        MessageStream ms = new MessageStream(server);

  MessageHandler.subscribe(DirectBrowseAckMessage.TYPE, ms);
        MessageHandler.subscribe(DirectBrowseErrorMessage.TYPE, ms);

        server.send(new DirectBrowseRequestMessage(getUser().getName()));
 
  // wait for ack
  IOException e = null;
        long startTime = System.currentTimeMillis();
        while (true) {
      long timeLeft = SERVER_TIMEOUT - (System.currentTimeMillis()
                - startTime);

      if (timeLeft <= 0) {
    e = new IOException("server timeout");
    break;
      }

      if (ms.hasNext(100)) {
    ServerMessage msg = ms.next();
   
    if (msg instanceof DirectBrowseErrorMessage) {
        DirectBrowseErrorMessage m = (DirectBrowseErrorMessage)msg;
        if (m.nick.equals(getUser().getName())) {
      e = new IOException(m.message);
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.