GLib.Socket – gio-2.0 Reference Manual
Packages
gio-2.0
GLib
Socket
blocking
broadcast
family
fd
keepalive
listen_backlog
local_address
multicast_loopback
multicast_ttl
protocol
remote_address
timeout
ttl
type
Socket
Socket.from_fd
accept
bind
check_connect_result
close
condition_check
condition_timed_wait
condition_wait
connect
create_source
get_available_bytes
get_blocking
get_broadcast
get_credentials
get_family
get_fd
get_keepalive
get_listen_backlog
get_local_address
get_multicast_loopback
get_multicast_ttl
get_protocol
get_remote_address
get_socket_type
get_timeout
get_ttl
is_closed
is_connected
join_multicast_group
leave_multicast_group
listen
receive
receive_from
receive_message
receive_with_blocking
send
send_message
send_to
send_with_blocking
set_blocking
set_broadcast
set_keepalive
set_listen_backlog
set_multicast_loopback
set_multicast_ttl
set_timeout
set_ttl
shutdown
speaks_ipv4
Socket
Object Hierarchy:
Description:
public
class
Socket
:
Object
,
Initable
Namespace:
GLib
Package:
gio-2.0
Content:
Properties:
public
bool
blocking
{
set
;
get
; }
public
bool
broadcast
{
set
;
get
; }
public
SocketFamily
family
{
construct
set
;
get
; }
public
int
fd
{
construct
set
;
get
; }
public
bool
keepalive
{
set
;
get
; }
public
int
listen_backlog
{
set
;
get
; }
public
SocketAddress
local_address
{
owned
get
; }
public
bool
multicast_loopback
{
set
;
get
; }
public
uint
multicast_ttl
{
set
;
get
; }
public
SocketProtocol
protocol
{
construct
set
;
get
; }
public
SocketAddress
remote_address
{
owned
get
; }
public
uint
timeout
{
set
;
get
; }
public
uint
ttl
{
set
;
get
; }
public
SocketType
type
{
construct
set
;
get
; }
Creation methods:
public
Socket
(
SocketFamily
family,
SocketType
type,
SocketProtocol
protocol)
throws
Error
public
Socket.from_fd
(
int
fd)
throws
Error
Methods:
public
Socket
accept
(
Cancellable
? cancellable =
null
)
throws
Error
public
bool
bind
(
SocketAddress
address,
bool
allow_reuse)
throws
Error
public
bool
check_connect_result
()
throws
Error
public
bool
close
()
throws
Error
public
IOCondition
condition_check
(
IOCondition
condition)
public
bool
condition_timed_wait
(
IOCondition
condition,
int64
timeout,
Cancellable
? cancellable =
null
)
throws
Error
public
bool
condition_wait
(
IOCondition
condition,
Cancellable
? cancellable =
null
)
throws
IOError
public
bool
connect
(
SocketAddress
address,
Cancellable
? cancellable =
null
)
throws
Error
public
SocketSource
create_source
(
IOCondition
condition,
Cancellable
? cancellable =
null
)
public
ssize_t
get_available_bytes
()
public
bool
get_blocking
()
public
bool
get_broadcast
()
public
Credentials
get_credentials
()
throws
Error
public
SocketFamily
get_family
()
public
int
get_fd
()
public
bool
get_keepalive
()
public
int
get_listen_backlog
()
public
SocketAddress
get_local_address
()
throws
Error
public
bool
get_multicast_loopback
()
public
uint
get_multicast_ttl
()
public
SocketProtocol
get_protocol
()
public
SocketAddress
get_remote_address
()
throws
Error
public
SocketType
get_socket_type
()
public
uint
get_timeout
()
public
uint
get_ttl
()
public
bool
is_closed
()
public
bool
is_connected
()
public
bool
join_multicast_group
(
InetAddress
group,
bool
source_specific,
string
? iface)
throws
Error
public
bool
leave_multicast_group
(
InetAddress
group,
bool
source_specific,
string
? iface)
throws
Error
public
bool
listen
()
throws
Error
public
ssize_t
receive
(
uint8
[] buffer,
Cancellable
? cancellable =
null
)
throws
Error
public
ssize_t
receive_from
(
out
SocketAddress
address,
uint8
[] buffer,
Cancellable
? cancellable =
null
)
throws
Error
public
ssize_t
receive_message
(
out
SocketAddress
address,
InputVector
[] vectors,
SocketControlMessage
[]? messages,
int
flags,
Cancellable
? cancellable =
null
)
throws
Error
public
ssize_t
receive_with_blocking
(
uint8
[] buffer,
bool
blocking,
Cancellable
? cancellable =
null
)
throws
Error
public
ssize_t
send
(
uint8
[] buffer,
Cancellable
? cancellable =
null
)
throws
Error
public
ssize_t
send_message
(
SocketAddress
? address,
OutputVector
[] vectors,
SocketControlMessage
[]? messages,
int
flags,
Cancellable
? cancellable =
null
)
throws
Error
public
ssize_t
send_to
(
SocketAddress
? address,
uint8
[] buffer,
Cancellable
? cancellable =
null
)
throws
Error
public
ssize_t
send_with_blocking
(
uint8
[] buffer,
bool
blocking,
Cancellable
? cancellable =
null
)
throws
Error
public
void
set_blocking
(
bool
blocking)
public
void
set_broadcast
(
bool
broadcast)
public
void
set_keepalive
(
bool
keepalive)
public
void
set_listen_backlog
(
int
backlog)
public
void
set_multicast_loopback
(
bool
loopback)
public
void
set_multicast_ttl
(
uint
ttl)
public
void
set_timeout
(
uint
timeout)
public
void
set_ttl
(
uint
ttl)
public
bool
shutdown
(
bool
shutdown_read,
bool
shutdown_write)
throws
Error
public
bool
speaks_ipv4
()
Inherited Members:
All known members inherited from class GLib.Object
@new
newv
new_valist
get_type
get_class
@ref
unref
ref_sink
weak_ref
weak_unref
add_weak_pointer
remove_weak_pointer
@get
@set
get_property
set_property
get_data
set_data
set_data_full
steal_data
get_qdata
set_qdata
set_qdata_full
steal_qdata
freeze_notify
thaw_notify
dispose
constructed
notify_property
connect
disconnect
add_toggle_ref
remove_toggle_ref
bind_property
notify
ref_count
All known members inherited from interface GLib.Initable
@new
new_valist
newv
init