Examples of contentUTF8()


Examples of com.trendrr.strest.server.ResponseBuilder.contentUTF8()

    while (true) {
      //build the response.
      ResponseBuilder res = new ResponseBuilder();
      res.txnStatusContinue();//lets the client know to expect more messages.     
      //set the content message.
      res.contentUTF8("this is message number: " + num++ + "\r\nThere are " + connections.size() + " concurrent connections");
      //send it to all connections
      connections.sendMessage(res.getResponse());
      Sleep.millis(500);
    }   
  }
View Full Code Here

Examples of com.trendrr.strest.server.ResponseBuilder.contentUTF8()

   
    //Now that I am registered to recieve connect message, then I
    //tell everyone else that I am online.
    ResponseBuilder response = new ResponseBuilder();
    response.txnStatus(StrestUtil.HEADERS.TXN_STATUS_VALUES.CONTINUE);
    response.contentUTF8(self);
    notifyConnect.sendMessage(response.getResponse());
   
   
    this.notifyConnect.addConnection(con);
    //now we send the user the list of all currently connected users
View Full Code Here

Examples of com.trendrr.strest.server.ResponseBuilder.contentUTF8()

      if (username.equals(self)) {
        continue; //don't need to notify about self
      }
      response = new ResponseBuilder();
      response.txnStatus(StrestUtil.HEADERS.TXN_STATUS_VALUES.CONTINUE);
      response.contentUTF8(username);
      con.sendMessage(response);
    }
  }

  /* (non-Javadoc)
 
View Full Code Here

Examples of com.trendrr.strest.server.ResponseBuilder.contentUTF8()

    this.onlineNow.remove(username);
    this.notifyMessage.remove(username);
    //now send the username to all who want connect notifications.
    ResponseBuilder response = new ResponseBuilder();
    response.txnStatus(StrestUtil.HEADERS.TXN_STATUS_VALUES.CONTINUE);
    response.contentUTF8(username);
    notifyDisconnect.sendMessage(response.getResponse());
  }
 
}
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.