Package ch.bailu.gtk.gio
Class SocketAddress
java.lang.Object
ch.bailu.gtk.type.Type
ch.bailu.gtk.type.Pointer
ch.bailu.gtk.gobject.Object
ch.bailu.gtk.gio.SocketAddress
- All Implemented Interfaces:
PointerInterface
- Direct Known Subclasses:
InetSocketAddress
,NativeSocketAddress
,UnixSocketAddress
#GSocketAddress is the equivalent of struct sockaddr in the BSD
sockets API. This is an abstract class; use #GInetSocketAddress
for internet sockets, or #GUnixSocketAddress for UNIX domain sockets.
sockets API. This is an abstract class; use #GInetSocketAddress
for internet sockets, or #GUnixSocketAddress for UNIX domain sockets.
-
Nested Class Summary
Nested classes/interfaces inherited from class ch.bailu.gtk.gobject.Object
Object.OnBindingTransformFunc, Object.OnDestroyNotify, Object.OnDuplicateFunc, Object.OnNotify, Object.OnToggleNotify, Object.OnWeakNotify
-
Field Summary
Fields inherited from class ch.bailu.gtk.gobject.Object
SIGNAL_ON_NOTIFY
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionImplements interfaceSocketConnectable
.static ClassHandler
int
Gets the socket family type of @address.static int
long
Gets the size of @address's native struct sockaddr.static long
static TypeSystem.TypeSize
static long
static TypeSystem.TypeSize
static SocketAddress
newFromNativeSocketAddress
(Pointer _native, long len) Creates a #GSocketAddress subclass corresponding to the native
struct sockaddr @native.boolean
Converts a #GSocketAddress to a native struct sockaddr, which can
be passed to low-level functions like connect() or bind().Methods inherited from class ch.bailu.gtk.gobject.Object
addToggleRef, bindProperty, bindProperty, bindPropertyFull, bindPropertyFull, bindPropertyWithClosures, bindPropertyWithClosures, compatControl, connect, connect, disconnect, disconnect, dupData, dupData, dupQdata, forceFloating, freezeNotify, get, get, getData, getData, getProperty, getProperty, getQdata, interfaceFindProperty, interfaceInstallProperty, isFloating, notify, notify, notifyByPspec, onNotify, ref, refSink, removeToggleRef, replaceData, replaceData, replaceQdata, runDispose, set, set, setData, setData, setDataFull, setDataFull, setProperty, setProperty, setQdata, setQdataFull, stealData, stealData, stealQdata, takeRef, thawNotify, unref, watchClosure, weakRef, weakUnref
Methods inherited from class ch.bailu.gtk.type.Pointer
asCPointer, cast, connectSignal, disconnectSignals, disconnectSignals, equals, hashCode, throwIfNull, throwNullPointerException, toString, unregisterCallbacks, unregisterCallbacks
Methods inherited from class ch.bailu.gtk.type.Type
asCPointer, asCPointer, asCPointerNotNull, asJnaPointer, asJnaPointer, asPointer, asPointer, cast, cast, throwIfNull
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface ch.bailu.gtk.type.PointerInterface
asCPointerNotNull, asJnaPointer, asPointer, isNotNull, isNull
-
Constructor Details
-
SocketAddress
-
-
Method Details
-
getClassHandler
-
newFromNativeSocketAddress
Creates a #GSocketAddress subclass corresponding to the native
struct sockaddr @native.- Parameters:
_native
- a pointer to a struct sockaddrlen
- the size of the memory location pointed to by @native- Returns:
- a new #GSocketAddress if @native could successfully be converted, otherwise %NULL
-
getFamily
public int getFamily()Gets the socket family type of @address.- Returns:
- the socket family type of @address
-
getNativeSize
public long getNativeSize()Gets the size of @address's native struct sockaddr.
You can use this to allocate memory to pass to
g_socket_address_to_native().- Returns:
- the size of the native struct sockaddr that @address represents
-
toNative
Converts a #GSocketAddress to a native struct sockaddr, which can
be passed to low-level functions like connect() or bind().
If not enough space is available, a %G_IO_ERROR_NO_SPACE error
is returned. If the address type is not known on the system
then a %G_IO_ERROR_NOT_SUPPORTED error is returned.- Parameters:
dest
- a pointer to a memory location that will contain the native struct sockaddrdestlen
- the size of @dest. Must be at least as large as g_socket_address_get_native_size()- Returns:
- %TRUE if @dest was filled in, %FALSE on error
- Throws:
AllocationError
-
asSocketConnectable
Implements interfaceSocketConnectable
. Call this to get access to interface functions.- Returns:
SocketConnectable
-
getTypeID
public static long getTypeID() -
getParentTypeID
public static long getParentTypeID() -
getTypeSize
-
getParentTypeSize
-
getInstanceSize
public static int getInstanceSize()
-