Package org.hornetq.spi.core.remoting

Examples of org.hornetq.spi.core.remoting.Connection


   private void sendPacketWithoutLock(final Packet packet)
   {
      packet.setChannelID(channel.getID());

      Connection conn = channel.getConnection().getTransportConnection();

      HornetQBuffer buffer = packet.encode(channel.getConnection());

      conn.write(buffer, false, false);
   }
View Full Code Here


                     Packet packet = new PacketImpl(PacketImpl.SESS_START);

                     packet.setChannelID(channel.getID());

                     Connection conn = channel.getConnection().getTransportConnection();

                     HornetQBuffer buffer = packet.encode(channel.getConnection());

                     conn.write(buffer, false, false);
                  }

                  resetCreditManager = true;
               }
View Full Code Here

   private void sendPacketWithoutLock(final Packet packet)
   {
      packet.setChannelID(channel.getID());

      Connection conn = channel.getConnection().getTransportConnection();

      HornetQBuffer buffer = packet.encode(channel.getConnection());

      conn.write(buffer, false, false);
   }
View Full Code Here

                                     new DummyConnectionLifeCycleListener(null),
                                     threadPool,
                                     threadPool,
                                     scheduledThreadPool);
      connector.start();
      Connection conn = connector.createConnection();
      connCreatedLatch.await(5, TimeUnit.SECONDS);
      for (int i = 0; i < numPackets; i++)
      {
         HornetQBuffer buff = conn.createBuffer(8);
         buff.writeInt(4);
         buff.writeInt(i);
         conn.write(buff);
         HornetQBuffer buff2 = conn.createBuffer(8);
         buff2.writeInt(4);
         buff2.writeInt(i);
         acceptorListener.connection.write(buff2);
      }
      Assert.assertTrue(acceptorLatch.await(10, TimeUnit.SECONDS));
      Assert.assertTrue(connectorLatch.await(10, TimeUnit.SECONDS));
      conn.close();
      Assert.assertEquals(acceptorHandler.messagesReceieved, numPackets);
      Assert.assertEquals(connectorHandler.messagesReceieved, numPackets);
      int i = 0;
      for (Integer j : acceptorHandler.messages)
      {
View Full Code Here

                                     new DummyConnectionLifeCycleListener(null),
                                     threadPool,
                                     threadPool,
                                     scheduledThreadPool);
      connector.start();
      Connection conn = connector.createConnection();
      connCreatedLatch.await(5, TimeUnit.SECONDS);
      for (int i = 0; i < numPackets; i++)
      {
         HornetQBuffer buff = conn.createBuffer(8);
         buff.writeInt(4);
         buff.writeInt(i);
         conn.write(buff);
      }
      for (int i = 0; i < numPackets; i++)
      {
         HornetQBuffer buff = conn.createBuffer(8);
         buff.writeInt(4);
         buff.writeInt(i);
         acceptorListener.connection.write(buff);
      }
      Assert.assertTrue(acceptorLatch.await(10, TimeUnit.SECONDS));
      Assert.assertTrue(connectorLatch.await(10, TimeUnit.SECONDS));
      conn.close();
      Assert.assertEquals(acceptorHandler.messagesReceieved, numPackets);
      Assert.assertEquals(connectorHandler.messagesReceieved, numPackets);
      int i = 0;
      for (Integer j : acceptorHandler.messages)
      {
View Full Code Here

                                     new DummyConnectionLifeCycleListener(null),
                                     threadPool,
                                     threadPool,
                                     scheduledThreadPool);
      connector.start();
      Connection conn = connector.createConnection();
      connCreatedLatch.await(5, TimeUnit.SECONDS);
      for (int i = 0; i < numPackets; i++)
      {
         HornetQBuffer buff = conn.createBuffer(8);
         buff.writeInt(4);
         buff.writeInt(i);
         acceptorListener.connection.write(buff);
      }

      for (int i = 0; i < numPackets; i++)
      {
         HornetQBuffer buff = conn.createBuffer(8);
         buff.writeInt(4);
         buff.writeInt(i);
         conn.write(buff);
      }
      acceptorLatch.await(10, TimeUnit.SECONDS);
      connectorLatch.await(10, TimeUnit.SECONDS);
      conn.close();
      Assert.assertEquals(acceptorHandler.messagesReceieved, numPackets);
      Assert.assertEquals(connectorHandler.messagesReceieved, numPackets);
      int i = 0;
      for (Integer j : acceptorHandler.messages)
      {
View Full Code Here

                                     new DummyConnectionLifeCycleListener(null),
                                     threadPool,
                                     threadPool,
                                     scheduledThreadPool);
      connector.start();
      Connection conn = connector.createConnection();
      connCreatedLatch.await(5, TimeUnit.SECONDS);
      for (int i = 0; i < numPackets; i++)
      {
         HornetQBuffer buff = conn.createBuffer(8);
         buff.writeInt(4);
         buff.writeInt(i);
         acceptorListener.connection.write(buff);
      }

      HornetQBuffer buff = conn.createBuffer(8);
      buff.writeInt(4);
      buff.writeInt(0);
      conn.write(buff);

      acceptorLatch.await(10, TimeUnit.SECONDS);
      connectorLatch.await(10, TimeUnit.SECONDS);
      conn.close();
      Assert.assertEquals(acceptorHandler.messagesReceieved, 1);
      Assert.assertEquals(connectorHandler.messagesReceieved, numPackets);
      int i = 0;
      for (Integer j : acceptorHandler.messages)
      {
View Full Code Here

                                     new DummyConnectionLifeCycleListener(null),
                                     threadPool,
                                     threadPool,
                                     scheduledThreadPool);
      connector.start();
      Connection conn = connector.createConnection();
      connCreatedLatch.await(5, TimeUnit.SECONDS);
      for (int i = 0; i < numPackets; i++)
      {
         HornetQBuffer buff = conn.createBuffer(8);
         buff.writeInt(4);
         buff.writeInt(i);
         acceptorListener.connection.write(buff);
      }

      acceptorLatch.await(10, TimeUnit.SECONDS);
      connectorLatch.await(10, TimeUnit.SECONDS);
      conn.close();
      Assert.assertEquals(acceptorHandler.messagesReceieved, 0);
      Assert.assertEquals(connectorHandler.messagesReceieved, numPackets);
      int i = 0;
      for (Integer j : acceptorHandler.messages)
      {
View Full Code Here

                                     new DummyConnectionLifeCycleListener(null),
                                     threadPool,
                                     threadPool,
                                     scheduledThreadPool);
      connector.start();
      Connection conn = connector.createConnection();
      connCreatedLatch.await(5, TimeUnit.SECONDS);
      for (int i = 0; i < numPackets; i++)
      {
         HornetQBuffer buff = conn.createBuffer(8);
         buff.writeInt(4);
         buff.writeInt(i);
         conn.write(buff);
      }
      acceptorLatch.await(100, TimeUnit.SECONDS);
      connectorLatch.await(0, TimeUnit.SECONDS);
      conn.close();
      Assert.assertEquals(acceptorHandler.messagesReceieved, numPackets);
      Assert.assertEquals(connectorHandler.messagesReceieved, 0);
      int i = 0;
      for (Integer j : acceptorHandler.messages)
      {
View Full Code Here

                                     new DummyConnectionLifeCycleListener(null),
                                     threadPool,
                                     threadPool,
                                     scheduledThreadPool);
      connector.start();
      Connection conn = connector.createConnection();
      connCreatedLatch.await(5, TimeUnit.SECONDS);
      for (int i = 0; i < numPackets; i++)
      {
         HornetQBuffer buff = conn.createBuffer(8);
         buff.writeInt(4);
         buff.writeInt(i);
         conn.write(buff);
      }
      acceptorLatch.await(10, TimeUnit.SECONDS);
      connectorLatch.await(0, TimeUnit.SECONDS);
      conn.close();
      Assert.assertEquals(acceptorHandler.messagesReceieved, numPackets);
      Assert.assertEquals(connectorHandler.messagesReceieved, 0);
      int i = 0;
      for (Integer j : acceptorHandler.messages)
      {
View Full Code Here

TOP

Related Classes of org.hornetq.spi.core.remoting.Connection

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.