Examples of receive()


Examples of freenet.io.xfer.BlockReceiver.receive()

       
            BlockReceiver br = new BlockReceiver(node.usm, pn, uid, prb, this, node.getTicker(), true, realTimeFlag, myTimeoutHandler, true);
           
             if(logMINOR) Logger.minor(this, "Receiving data (for offer reply)");
             receivingAsync = true;
             br.receive(new BlockReceiverCompletion() {
              
          @Override
          public void blockReceived(byte[] data) {
                synchronized(RequestSender.this) {
                  transferringFrom = null;

Examples of freenet.io.xfer.BulkReceiver.receive()

    PartiallyReceivedBulk prb = new PartiallyReceivedBulk(node.usm, buf.length, Node.PACKET_SIZE, raf, false);
    BulkReceiver br = new BulkReceiver(prb, source, xferUID, ctr);
    if (logMINOR) {
      Logger.minor(OpennetManager.class, "Receiving noderef (reply="+isReply+") as bulk transfer for request uid "+uid+" with transfer "+xferUID+" from "+source);
    }
    if (!br.receive()) {
      if (source.isConnected()) {
        String msg = "Failed to receive noderef bulk transfer : "
          +RetrievalException.getErrString(prb.getAbortReason())+" : "
          +prb.getAbortDescription()+" from "+source;
        if (prb.getAbortReason() != RetrievalException.SENDER_DISCONNECTED) {

Examples of java.net.DatagramSocket.receive()

      socket = new DatagramSocket();
      broadcast(udpPort, socket);
      socket.setSoTimeout(timeoutMillis);
      DatagramPacket packet = new DatagramPacket(new byte[0], 0);
      try {
        socket.receive(packet);
      } catch (SocketTimeoutException ex) {
        if (INFO) info("kryonet", "Host discovery timed out.");
        return null;
      }
      if (INFO) info("kryonet", "Discovered server: " + packet.getAddress());

Examples of java.net.MulticastSocket.receive()

                    s.joinGroup(address);
                    s.setReceiveBufferSize(64 * 1024);
                    s.setSoTimeout(5000);
                    byte[] bytes = new byte[64 * 1024];
                    DatagramPacket p = new DatagramPacket(bytes, bytes.length, address, Integer.parseInt(PORT));
                    s.receive(p);
                    SocketAddress sa = p.getSocketAddress();
                    String incoming = new String(p.getData(), 0, p.getLength(), "UTF-8");
                    int idx = incoming.indexOf("MessageID");
                    idx = incoming.indexOf('>', idx);
                    incoming = incoming.substring(idx + 1);

Examples of java.nio.channels.DatagramChannel.receive()

  public InetSocketAddress readFromAddress () throws IOException {
    DatagramChannel datagramChannel = this.datagramChannel;
    if (datagramChannel == null) throw new SocketException("Connection is closed.");
    lastCommunicationTime = System.currentTimeMillis();
    return (InetSocketAddress)datagramChannel.receive(readBuffer);
  }

  public Object readObject (Connection connection) {
    readBuffer.flip();
    try {

Examples of javax.bluetooth.L2CAPConnection.receive()

            outgoing.setText("");
            conn.send(bytes)
            }*/

            if (conn.ready()) {
                conn.receive(receiveBytes);
                incoming.setText(receiveBytes.toString());
            }
            //}
        }
        catch (IOException e) { }

Examples of javax.isolate.Link.receive()

     */
    public static void main(String[] args) {
        Link cl = Isolate.getLinks()[0];
        CommandRunner cr;
        try {
            ObjectLinkMessage message = (ObjectLinkMessage) cl.receive();
            cr = (CommandRunner) message.extract();
            Map<String, String> env = cr.getEnv();
            int envSize = (env == null) ? 0 : env.size();
            byte[][] binEnv = new byte[envSize * 2][];
            if (envSize > 0) {

Examples of javax.jms.JMSConsumer.receive()

        int receivedMessages = 0;
        try(JMSContext context = factory.createContext()) {
            JMSConsumer consumer = context.createConsumer(queue);
            Message m;
            do {
                m = consumer.receive(1000);
                if (m != null) {
                    receivedMessages++;
                }
            }
            while (m != null);

Examples of javax.jms.MessageConsumer.receive()

    MessageConsumer consumer = session.createConsumer(dmq);

    cnx.start();
   
    for (int i=0; i<3; i++) {
      TextMessage msg = (TextMessage) consumer.receive();
      System.out.println("\nreceives: \"" + msg.getText() + "\", " +
                         "JMS_JORAM_ERRORCOUNT=" + msg.getIntProperty("JMS_JORAM_ERRORCOUNT"));
      System.out.println("JMS_JORAM_ERRORCAUSE_1=" + msg.getStringProperty("JMS_JORAM_ERRORCAUSE_1") + ", " +
                         "JMS_JORAM_ERRORCODE_1=" + msg.getStringProperty("JMS_JORAM_ERRORCODE_1"));
      System.out.println("JMSXDeliveryCount=" + msg.getIntProperty("JMSXDeliveryCount"));

Examples of javax.jms.QueueReceiver.receive()

          // Use this method to receive the next message that arrives
          // within the specified timeout interval.
          // This call blocks until a message arrives, the timeout
          // expires,
          // or this message consumer is closed.
          message = (TextMessage) qr.receive(1000);

          if (message == null)
          {
            System.out.println("Keine Nachricht vorhanden!");
            messageFound = true;
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.