Package jline.cli

Class LineClient

java.lang.Object
org.java_websocket.WebSocketAdapter
org.java_websocket.AbstractWebSocket
org.java_websocket.client.WebSocketClient
jline.cli.LineClient
All Implemented Interfaces:
Runnable, org.java_websocket.WebSocket, org.java_websocket.WebSocketListener

public class LineClient extends org.java_websocket.client.WebSocketClient
LineClient is a WebSocket client used to communicate with the LINE Solver server. It extends the WebSocketClient class and provides methods for connecting to the server and sending messages.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    The message to be sent to the server.

    Fields inherited from class org.java_websocket.client.WebSocketClient

    uri
  • Constructor Summary

    Constructors
    Constructor
    Description
    LineClient(URI serverURI, String msg)
    Constructs a new LineClient instance.
  • Method Summary

    Modifier and Type
    Method
    Description
    static void
    main(String[] args)
    The main method, which serves as the entry point for the program.
    void
    onClose(int code, String reason, boolean remote)
     
    void
     
    void
    onMessage(String message)
     
    void
    onOpen(org.java_websocket.handshake.ServerHandshake handshakedata)
     

    Methods inherited from class org.java_websocket.client.WebSocketClient

    addHeader, clearHeaders, close, close, close, closeBlocking, closeConnection, connect, connectBlocking, connectBlocking, getAttachment, getConnection, getConnections, getDraft, getLocalSocketAddress, getLocalSocketAddress, getReadyState, getRemoteSocketAddress, getRemoteSocketAddress, getResourceDescriptor, getSocket, getSSLSession, getURI, hasBufferedData, hasSSLSupport, isClosed, isClosing, isFlushAndClose, isOpen, onCloseInitiated, onClosing, onMessage, onSetSSLParameters, onWebsocketClose, onWebsocketCloseInitiated, onWebsocketClosing, onWebsocketError, onWebsocketMessage, onWebsocketMessage, onWebsocketOpen, onWriteDemand, reconnect, reconnectBlocking, removeHeader, run, send, send, send, sendFragmentedFrame, sendFrame, sendFrame, sendPing, setAttachment, setDnsResolver, setProxy, setSocket, setSocketFactory

    Methods inherited from class org.java_websocket.AbstractWebSocket

    getConnectionLostTimeout, isReuseAddr, isTcpNoDelay, setConnectionLostTimeout, setReuseAddr, setTcpNoDelay, startConnectionLostTimer, stopConnectionLostTimer

    Methods inherited from class org.java_websocket.WebSocketAdapter

    onPreparePing, onWebsocketHandshakeReceivedAsClient, onWebsocketHandshakeReceivedAsServer, onWebsocketHandshakeSentAsClient, onWebsocketPing, onWebsocketPong

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • message

      public String message
      The message to be sent to the server.
  • Constructor Details

    • LineClient

      public LineClient(URI serverURI, String msg)
      Constructs a new LineClient instance.
      Parameters:
      serverURI - the URI of the server to connect to.
      msg - the message to be sent to the server.
  • Method Details

    • main

      public static void main(String[] args) throws URISyntaxException, org.apache.commons.cli.ParseException
      The main method, which serves as the entry point for the program. It processes command-line arguments and establishes a connection with the server.
      Parameters:
      args - command-line arguments specifying the server IP, port, and other options.
      Throws:
      URISyntaxException - if the URI syntax is incorrect.
      org.apache.commons.cli.ParseException - if there is an error in parsing the command-line arguments.
    • onOpen

      public void onOpen(org.java_websocket.handshake.ServerHandshake handshakedata)
      Specified by:
      onOpen in class org.java_websocket.client.WebSocketClient
    • onMessage

      public void onMessage(String message)
      Specified by:
      onMessage in class org.java_websocket.client.WebSocketClient
    • onClose

      public void onClose(int code, String reason, boolean remote)
      Specified by:
      onClose in class org.java_websocket.client.WebSocketClient
    • onError

      public void onError(Exception ex)
      Specified by:
      onError in class org.java_websocket.client.WebSocketClient