TcpConnection

open class TcpConnection(pointer: <Error class: unknown class><<Error class: unknown class>>) : SocketConnection

This is the subclass of class@Gio.SocketConnection that is created for TCP/IP sockets.

Since

2.22

Inheritors

Constructors

Link copied to clipboard
constructor(pointer: <Error class: unknown class><<Error class: unknown class>>)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
val gioIOStreamPointer: <Error class: unknown class><<Error class: unknown class>>
Link copied to clipboard
val gioSocketConnectionPointer: <Error class: unknown class><<Error class: unknown class>>
Link copied to clipboard
val gioTcpConnectionPointer: <Error class: unknown class><<Error class: unknown class>>
Link copied to clipboard

Whether method@Gio.IOStream.close does a graceful disconnect.

Link copied to clipboard

The class@Gio.InputStream to read from.

Link copied to clipboard

The class@Gio.OutputStream to write to.

Link copied to clipboard
open val socket: Socket

The underlying class@Gio.Socket.

Functions

Link copied to clipboard
open fun clearPending()

Clears the pending flag on @stream.

Link copied to clipboard
open fun close(cancellable: Cancellable? = null): <Error class: unknown class><Boolean>

Closes the stream, releasing resources related to it. This will also close the individual input and output streams, if they are not already closed.

Link copied to clipboard
open fun closeAsync(ioPriority: Int, cancellable: Cancellable? = null, callback: AsyncReadyCallback)

Requests an asynchronous close of the stream, releasing resources related to it. When the operation is finished @callback will be called. You can then call g_io_stream_close_finish() to get the result of the operation.

Link copied to clipboard
open fun closeFinish(result: AsyncResult): <Error class: unknown class><Boolean>

Closes a stream.

Link copied to clipboard
open fun connect(address: SocketAddress, cancellable: Cancellable? = null): <Error class: unknown class><Boolean>

Connect @connection to the specified remote address.

Link copied to clipboard
open fun connectAsync(address: SocketAddress, cancellable: Cancellable? = null, callback: AsyncReadyCallback)

Asynchronously connect @connection to the specified remote address.

Link copied to clipboard
open fun connectFinish(result: AsyncResult): <Error class: unknown class><Boolean>

Gets the result of a g_socket_connection_connect_async() call.

Link copied to clipboard

Checks if graceful disconnects are used. See g_tcp_connection_set_graceful_disconnect().

Link copied to clipboard

Gets the input stream for this object. This is used for reading.

Link copied to clipboard
open fun getLocalAddress(): <Error class: unknown class><SocketAddress>

Try to get the local address of a socket connection.

Link copied to clipboard

Gets the output stream for this object. This is used for writing.

Link copied to clipboard
open fun getRemoteAddress(): <Error class: unknown class><SocketAddress>

Try to get the remote address of a socket connection.

Link copied to clipboard
open fun getSocket(): Socket

Gets the underlying #GSocket object of the connection. This can be useful if you want to do something unusual on it not supported by the #GSocketConnection APIs.

Link copied to clipboard
open fun hasPending(): Boolean

Checks if a stream has pending actions.

Link copied to clipboard
open fun isClosed(): Boolean

Checks if a stream is closed.

Link copied to clipboard
open fun isConnected(): Boolean

Checks if @connection is connected. This is equivalent to calling g_socket_is_connected() on @connection's underlying #GSocket.

Link copied to clipboard
open fun setGracefulDisconnect(gracefulDisconnect: Boolean)

This enables graceful disconnects on close. A graceful disconnect means that we signal the receiving end that the connection is terminated and wait for it to close the connection before closing the connection.

Link copied to clipboard
open fun setPending(): <Error class: unknown class><Boolean>

Sets @stream to have actions pending. If the pending flag is already set or @stream is closed, it will return false and set

Link copied to clipboard
open fun spliceAsync(stream2: IOStream, flags: IOStreamSpliceFlags, ioPriority: Int, cancellable: Cancellable? = null, callback: AsyncReadyCallback)

Asynchronously splice the output stream of @stream1 to the input stream of