Package com.barchart.udt

Examples of com.barchart.udt.SocketUDT


    logClassPath();

    try {

      final SocketUDT socket = new SocketUDT(TypeUDT.DATAGRAM);

      log.info("made socketID={}", socket.getSocketId());

      log.info("socket status={}", socket.getStatus());

      log.info("socket isOpen={}", socket.isOpen());

      log.info("socket isBlocking={}", socket.isBlocking());

      log.info("socket options{}", socket.toStringOptions());

      assertTrue(true);

    } catch (Throwable e) {
View Full Code Here


    try {

      TypeUDT type = TypeUDT.STREAM;

      SocketUDT socket = new SocketUDT(type);

      // socket.test();

      StringBuilder text = new StringBuilder(1024);

      OptionUDT.appendSnapshot(socket, text);
      text.append("\t\n");

      socket.setOption(OptionUDT.UDT_MSS, 1234);
      socket.setOption(OptionUDT.UDT_SNDSYN, false);
      socket.setOption(OptionUDT.UDT_RCVSYN, false);
      socket.setOption(OptionUDT.UDP_RCVBUF, 12345678);
      socket.setOption(OptionUDT.UDP_SNDBUF, 23456789);
      socket.setOption(OptionUDT.UDT_MAXBW, 777777777L);

      OptionUDT.appendSnapshot(socket, text);
      text.append("\t\n");

      log.info("options; {}", text);

      InetSocketAddress localSocketAddress;
      InetSocketAddress remoteSocketAddress;

      localSocketAddress = new InetSocketAddress(0);

      socket.bind(localSocketAddress);

      int code = socket.getErrorCode();
      String message = socket.getErrorMessage();
      socket.clearError();
      log.info("code={} message={}", code, message);

      localSocketAddress = socket.getLocalSocketAddress();
      log.info("localSocketAddress={}", localSocketAddress);

      remoteSocketAddress = socket.getRemoteSocketAddress();
      log.info("remoteSocketAddress={}", remoteSocketAddress);

      //

      log.info("option test");
View Full Code Here

    InetAddress address;

    TypeUDT type = TypeUDT.STREAM;

    SocketUDT socket = new SocketUDT(type);

    SocketUDT client = socket.accept();

    assert client != null;

    System.out.println(client);
View Full Code Here

      long count = 0;

      while (true) {

        SocketUDT socket = new SocketUDT(type);

        queue.put(socket);

        // socket.close();
        // socket = null;
View Full Code Here

    ResourceUDT.setLibraryLoaderClassName(LibraryLoaderDefaultUDT.class.getName());

    ResourceUDT.setLibraryExtractLocation("./target/test-testLoadWithProps-" + HelperUtils.getRandomString());

    SocketUDT socket = new SocketUDT(TypeUDT.DATAGRAM);

    assertTrue(socket.isOpen());

  }
View Full Code Here

  @Override
  public void run() {

    try {

      final SocketUDT connectorSocket = socket.accept();

      final Runnable serviceTask = factory.newService(connectorSocket);

      executor.submit(serviceTask);
View Full Code Here

  }

  StreamServer(final TypeUDT type, final InetSocketAddress serverAddress,
      final ServiceFactory factory) throws Exception {

    super(new SocketUDT(type), HelperUtils.getLocalSocketAddress(),
        serverAddress);

    this.factory = factory;

    this.executor = Executors.newCachedThreadPool();
View Full Code Here

  final ExecutorService executor;

  StreamClient(final TypeUDT type, final InetSocketAddress remoteAddress)
      throws Exception {

    super(new SocketUDT(type), HelperUtils.getLocalSocketAddress(),
        remoteAddress);

    this.executor = Executors.newCachedThreadPool();

  }
View Full Code Here

    startThreadedServer(serverAddress, readStrategy);

    //

    final SocketUDT clientSocket = new SocketUDT(TypeUDT.STREAM);

    final InetSocketAddress clientAddress = HelperUtils
        .getLocalSocketAddress();

    clientSocket.bind(clientAddress);
    assertTrue("Socket not bound!!", clientSocket.isBound());

    clientSocket.connect(serverAddress);
    assertTrue("Socket not connected!", clientSocket.isConnected());

    final InputStream socketIn = new NetInputStreamUDT(clientSocket);
    final OutputStream socketOut = new NetOutputStreamUDT(clientSocket);

    //Thread.sleep(1000);
View Full Code Here

      // String absolutePath = mingwDLL.getAbsolutePath();
      // System.load(absolutePath);

      TypeUDT type = TypeUDT.STREAM;

      SocketUDT socket = new SocketUDT(type);

      boolean isOpen = socket.isOpen();

      log.info("isOpen={}", isOpen);

    } catch (Throwable e) {
      log.error("unexpected", e);
View Full Code Here

TOP

Related Classes of com.barchart.udt.SocketUDT

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.