Class Socket
- Namespace
- Gio
- Assembly
- Gio-2.0.dll
public class Socket : Object, IObject, INotifyPropertyChanged, IDisposable, DatagramBased, Initable, IHandle, GTypeProvider
- Inheritance
-
Socket
- Implements
-
- Inherited Members
-
Constructors
Socket(bool, params ConstructArgument[])
protected Socket(bool owned, params ConstructArgument[] constructArguments)
Parameters
owned
bool
constructArguments
ConstructArgument[]
Socket(IntPtr, bool)
protected Socket(IntPtr ptr, bool ownedRef)
Parameters
ptr
IntPtr
ownedRef
bool
Fields
BlockingPropertyDefinition
public static readonly Property<bool, Socket> BlockingPropertyDefinition
Field Value
- Property<bool, Socket>
BroadcastPropertyDefinition
public static readonly Property<bool, Socket> BroadcastPropertyDefinition
Field Value
- Property<bool, Socket>
FamilyPropertyDefinition
public static readonly Property<SocketFamily, Socket> FamilyPropertyDefinition
Field Value
- Property<SocketFamily, Socket>
FdPropertyDefinition
public static readonly Property<int, Socket> FdPropertyDefinition
Field Value
- Property<int, Socket>
KeepalivePropertyDefinition
public static readonly Property<bool, Socket> KeepalivePropertyDefinition
Field Value
- Property<bool, Socket>
ListenBacklogPropertyDefinition
public static readonly Property<int, Socket> ListenBacklogPropertyDefinition
Field Value
- Property<int, Socket>
MulticastLoopbackPropertyDefinition
public static readonly Property<bool, Socket> MulticastLoopbackPropertyDefinition
Field Value
- Property<bool, Socket>
MulticastTtlPropertyDefinition
public static readonly Property<uint, Socket> MulticastTtlPropertyDefinition
Field Value
- Property<uint, Socket>
ProtocolPropertyDefinition
public static readonly Property<SocketProtocol, Socket> ProtocolPropertyDefinition
Field Value
- Property<SocketProtocol, Socket>
TimeoutPropertyDefinition
public static readonly Property<uint, Socket> TimeoutPropertyDefinition
Field Value
- Property<uint, Socket>
TtlPropertyDefinition
public static readonly Property<uint, Socket> TtlPropertyDefinition
Field Value
- Property<uint, Socket>
TypePropertyDefinition
public static readonly Property<SocketType, Socket> TypePropertyDefinition
Field Value
- Property<SocketType, Socket>
Properties
Blocking
public bool Blocking { get; set; }
Property Value
- bool
Broadcast
public bool Broadcast { get; set; }
Property Value
- bool
Family
public SocketFamily Family { get; }
Property Value
- SocketFamily
Fd
Property Value
- int
Keepalive
public bool Keepalive { get; set; }
Property Value
- bool
ListenBacklog
public int ListenBacklog { get; set; }
Property Value
- int
MulticastLoopback
public bool MulticastLoopback { get; set; }
Property Value
- bool
MulticastTtl
public uint MulticastTtl { get; set; }
Property Value
- uint
Protocol
public SocketProtocol Protocol { get; }
Property Value
- SocketProtocol
Timeout
public uint Timeout { get; set; }
Property Value
- uint
Ttl
public uint Ttl { get; set; }
Property Value
- uint
Type
public SocketType Type { get; }
Property Value
- SocketType
Methods
Accept(Cancellable?)
[Version("2.22")]
public Socket Accept(Cancellable? cancellable)
Parameters
cancellable
Cancellable
Returns
- Socket
Bind(SocketAddress, bool)
[Version("2.22")]
public bool Bind(SocketAddress address, bool allowReuse)
Parameters
address
SocketAddress
allowReuse
bool
Returns
- bool
CheckConnectResult()
[Version("2.22")]
public bool CheckConnectResult()
Returns
- bool
Close()
[Version("2.22")]
public bool Close()
Returns
- bool
ConditionCheck(IOCondition)
[Version("2.22")]
public IOCondition ConditionCheck(IOCondition condition)
Parameters
condition
IOCondition
Returns
- IOCondition
ConditionTimedWait(IOCondition, long, Cancellable?)
[Version("2.32")]
public bool ConditionTimedWait(IOCondition condition, long timeoutUs, Cancellable? cancellable)
Parameters
condition
IOCondition
timeoutUs
long
cancellable
Cancellable
Returns
- bool
ConditionWait(IOCondition, Cancellable?)
[Version("2.22")]
public bool ConditionWait(IOCondition condition, Cancellable? cancellable)
Parameters
condition
IOCondition
cancellable
Cancellable
Returns
- bool
ConditionWait(IOCondition, long, Cancellable?)
[Version("2.48")]
public bool ConditionWait(IOCondition condition, long timeout, Cancellable? cancellable)
Parameters
condition
IOCondition
timeout
long
cancellable
Cancellable
Returns
- bool
Connect(SocketAddress, Cancellable?)
[Version("2.22")]
public bool Connect(SocketAddress address, Cancellable? cancellable)
Parameters
address
SocketAddress
cancellable
Cancellable
Returns
- bool
ConnectionFactoryCreateConnection()
[Version("2.22")]
public SocketConnection ConnectionFactoryCreateConnection()
Returns
- SocketConnection
CreateSource(IOCondition, Cancellable?)
[Version("2.22")]
public Source CreateSource(IOCondition condition, Cancellable? cancellable)
Parameters
condition
IOCondition
cancellable
Cancellable
Returns
- Source
GetAvailableBytes()
[Version("2.32")]
public long GetAvailableBytes()
Returns
- long
GetBlocking()
[Version("2.22")]
public bool GetBlocking()
Returns
- bool
GetBroadcast()
[Version("2.32")]
public bool GetBroadcast()
Returns
- bool
GetCredentials()
[Version("2.26")]
public Credentials GetCredentials()
Returns
- Credentials
GetFamily()
[Version("2.22")]
public SocketFamily GetFamily()
Returns
- SocketFamily
GetFd()
[Version("2.22")]
public int GetFd()
Returns
- int
GetGType()
public static Type GetGType()
Returns
- Type
GetKeepalive()
[Version("2.22")]
public bool GetKeepalive()
Returns
- bool
GetListenBacklog()
[Version("2.22")]
public int GetListenBacklog()
Returns
- int
GetLocalAddress()
[Version("2.22")]
public SocketAddress GetLocalAddress()
Returns
- SocketAddress
GetMulticastLoopback()
[Version("2.32")]
public bool GetMulticastLoopback()
Returns
- bool
GetMulticastTtl()
[Version("2.32")]
public uint GetMulticastTtl()
Returns
- uint
GetOption(int, int, out int)
[Version("2.36")]
public bool GetOption(int level, int optname, out int value)
Parameters
level
int
optname
int
value
int
Returns
- bool
GetProtocol()
[Version("2.22")]
public SocketProtocol GetProtocol()
Returns
- SocketProtocol
GetRemoteAddress()
[Version("2.22")]
public SocketAddress GetRemoteAddress()
Returns
- SocketAddress
GetSocketType()
[Version("2.22")]
public SocketType GetSocketType()
Returns
- SocketType
GetTimeout()
[Version("2.26")]
public uint GetTimeout()
Returns
- uint
GetTtl()
[Version("2.32")]
public uint GetTtl()
Returns
- uint
Init(Cancellable?)
[Version("2.22")]
public bool Init(Cancellable? cancellable)
Parameters
cancellable
Cancellable
Returns
- bool
IsClosed()
[Version("2.22")]
public bool IsClosed()
Returns
- bool
IsConnected()
[Version("2.22")]
public bool IsConnected()
Returns
- bool
JoinMulticastGroup(InetAddress, bool, string?)
[Version("2.32")]
public bool JoinMulticastGroup(InetAddress group, bool sourceSpecific, string? iface)
Parameters
group
InetAddress
sourceSpecific
bool
iface
string
Returns
- bool
JoinMulticastGroupSsm(InetAddress, InetAddress?, string?)
[Version("2.56")]
public bool JoinMulticastGroupSsm(InetAddress group, InetAddress? sourceSpecific, string? iface)
Parameters
group
InetAddress
sourceSpecific
InetAddress
iface
string
Returns
- bool
LeaveMulticastGroup(InetAddress, bool, string?)
[Version("2.32")]
public bool LeaveMulticastGroup(InetAddress group, bool sourceSpecific, string? iface)
Parameters
group
InetAddress
sourceSpecific
bool
iface
string
Returns
- bool
LeaveMulticastGroupSsm(InetAddress, InetAddress?, string?)
[Version("2.56")]
public bool LeaveMulticastGroupSsm(InetAddress group, InetAddress? sourceSpecific, string? iface)
Parameters
group
InetAddress
sourceSpecific
InetAddress
iface
string
Returns
- bool
Listen()
[Version("2.22")]
public bool Listen()
Returns
- bool
New(SocketFamily, SocketType, SocketProtocol)
[Version("2.22")]
public static Socket New(SocketFamily family, SocketType type, SocketProtocol protocol)
Parameters
family
SocketFamily
type
SocketType
protocol
SocketProtocol
Returns
- Socket
NewFromFd(int)
[Version("2.22")]
public static Socket NewFromFd(int fd)
Parameters
fd
int
Returns
- Socket
Receive(Span<byte>, Cancellable?)
[Version("2.22")]
public long Receive(Span<byte> buffer, Cancellable? cancellable)
Parameters
buffer
Span<byte>
cancellable
Cancellable
Returns
- long
ReceiveBytes(nuint, long, Cancellable?)
[Version("2.80")]
public Bytes ReceiveBytes(nuint size, long timeoutUs, Cancellable? cancellable)
Parameters
size
nuint
timeoutUs
long
cancellable
Cancellable
Returns
- Bytes
[Version("2.48")]
public int ReceiveMessages(InputMessage[] messages, int flags, Cancellable? cancellable)
Parameters
messages
InputMessage[]
flags
int
cancellable
Cancellable
Returns
- int
[Version("2.48")]
public int ReceiveMessages(InputMessage[] messages, int flags, long timeout, Cancellable? cancellable)
Parameters
messages
InputMessage[]
flags
int
timeout
long
cancellable
Cancellable
Returns
- int
ReceiveWithBlocking(Span<byte>, bool, Cancellable?)
[Version("2.26")]
public long ReceiveWithBlocking(Span<byte> buffer, bool blocking, Cancellable? cancellable)
Parameters
buffer
Span<byte>
blocking
bool
cancellable
Cancellable
Returns
- long
Send(Span<byte>, Cancellable?)
[Version("2.22")]
public long Send(Span<byte> buffer, Cancellable? cancellable)
Parameters
buffer
Span<byte>
cancellable
Cancellable
Returns
- long
SendMessages(OutputMessage[], int, Cancellable?)
[Version("2.44")]
public int SendMessages(OutputMessage[] messages, int flags, Cancellable? cancellable)
Parameters
messages
OutputMessage[]
flags
int
cancellable
Cancellable
Returns
- int
SendMessages(OutputMessage[], int, long, Cancellable?)
[Version("2.48")]
public int SendMessages(OutputMessage[] messages, int flags, long timeout, Cancellable? cancellable)
Parameters
messages
OutputMessage[]
flags
int
timeout
long
cancellable
Cancellable
Returns
- int
SendTo(SocketAddress?, Span<byte>, Cancellable?)
[Version("2.22")]
public long SendTo(SocketAddress? address, Span<byte> buffer, Cancellable? cancellable)
Parameters
address
SocketAddress
buffer
Span<byte>
cancellable
Cancellable
Returns
- long
SendWithBlocking(Span<byte>, bool, Cancellable?)
[Version("2.26")]
public long SendWithBlocking(Span<byte> buffer, bool blocking, Cancellable? cancellable)
Parameters
buffer
Span<byte>
blocking
bool
cancellable
Cancellable
Returns
- long
SetBlocking(bool)
[Version("2.22")]
public void SetBlocking(bool blocking)
Parameters
blocking
bool
SetBroadcast(bool)
[Version("2.32")]
public void SetBroadcast(bool broadcast)
Parameters
broadcast
bool
SetKeepalive(bool)
[Version("2.22")]
public void SetKeepalive(bool keepalive)
Parameters
keepalive
bool
SetListenBacklog(int)
[Version("2.22")]
public void SetListenBacklog(int backlog)
Parameters
backlog
int
SetMulticastLoopback(bool)
[Version("2.32")]
public void SetMulticastLoopback(bool loopback)
Parameters
loopback
bool
SetMulticastTtl(uint)
[Version("2.32")]
public void SetMulticastTtl(uint ttl)
Parameters
ttl
uint
SetOption(int, int, int)
[Version("2.36")]
public bool SetOption(int level, int optname, int value)
Parameters
level
int
optname
int
value
int
Returns
- bool
SetTimeout(uint)
[Version("2.26")]
public void SetTimeout(uint timeout)
Parameters
timeout
uint
SetTtl(uint)
[Version("2.32")]
public void SetTtl(uint ttl)
Parameters
ttl
uint
Shutdown(bool, bool)
[Version("2.22")]
public bool Shutdown(bool shutdownRead, bool shutdownWrite)
Parameters
shutdownRead
bool
shutdownWrite
bool
Returns
- bool
SpeaksIpv4()
[Version("2.22")]
public bool SpeaksIpv4()
Returns
- bool