Package org.auto.comet

Examples of org.auto.comet.Socket


  }

  public void send(Serializable id, String msg) {
    readLock.lock();
    try {
      Socket socket = this.socketMapping.get(id);
      if (null != socket) {
        socket.send(msg);
      } else {
        throw new RuntimeException("Can't find socket!");
      }
    } finally {
      readLock.unlock();
View Full Code Here


  public void sendExcept(Serializable exceptId, String msg) {
    readLock.lock();
    try {
      for (Entry<Serializable, Socket> entry : socketMapping.entrySet()) {
        Serializable id = entry.getKey();
        Socket socket = entry.getValue();
        if (id.equals(exceptId)) {
          continue;
        }
        socket.send(msg);
      }
    } finally {
      readLock.unlock();
    }
  }
View Full Code Here

  public void sendToAll(String msg) {
    readLock.lock();
    try {
      for (Entry<Serializable, Socket> entry : socketMapping.entrySet()) {
        Socket socket = entry.getValue();
        socket.send(msg);
      }
    } finally {
      readLock.unlock();
    }
  }
View Full Code Here

TOP

Related Classes of org.auto.comet.Socket

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.