Class TcpWrapperConnection

All Implemented Interfaces:
AutoCloseable, Proxy, AutoCloseable

@Generated("org.javagi.JavaGI") public class TcpWrapperConnection extends TcpConnection
A GTcpWrapperConnection can be used to wrap a IOStream that is based on a Socket, but which is not actually a SocketConnection. This is used by SocketClient so that it can always return a SocketConnection, even when the connection it has actually created is not directly a SocketConnection.
Since:
2.28
  • Constructor Details

    • TcpWrapperConnection

      public TcpWrapperConnection(MemorySegment address)
      Create a TcpWrapperConnection instance for the provided memory address.
      Parameters:
      address - the memory address of the native object
    • TcpWrapperConnection

      public TcpWrapperConnection(IOStream baseIoStream, Socket socket)
      Wraps baseIoStream and socket together as a GSocketConnection.
      Parameters:
      baseIoStream - the GIOStream to wrap
      socket - the GSocket associated with baseIoStream
      Since:
      2.28
    • TcpWrapperConnection

      public TcpWrapperConnection()
      Create a new TcpWrapperConnection.
  • Method Details

    • getType

      public static @Nullable Type getType()
      Get the GType of the TcpWrapperConnection class.
      Returns:
      the GType
    • getMemoryLayout

      public static MemoryLayout getMemoryLayout()
      The memory layout of the native struct.
      Returns:
      the memory layout
    • asParent

      protected TcpWrapperConnection asParent()
      Return this instance as if it were its parent type. Comparable to the Java super keyword, but ensures the parent typeclass is also used in native code.
      Overrides:
      asParent in class TcpConnection
      Returns:
      the instance as if it were its parent type
    • getBaseIoStream

      public IOStream getBaseIoStream()
      Gets conn's base GIOStream
      Returns:
      conn's base GIOStream
    • builder

      public static TcpWrapperConnection.Builder<? extends TcpWrapperConnection.Builder> builder()
      A TcpWrapperConnection.Builder object constructs a TcpWrapperConnection with the specified properties. Use the various set...() methods to set properties, and finish construction with TcpWrapperConnection.Builder.build().
      Returns:
      the builder object