Infinityd.TcpServer¶
- Subclasses:
None
Methods¶
- Inherited:
- Structs:
|
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
|
|
|
Properties¶
Name |
Type |
Flags |
Short Description |
|---|---|---|---|
r/w/co |
I/O handler |
||
r/w |
Keepalive settings for accepted connections |
||
r/w |
Address to bind to |
||
r/w |
Port to bind to |
||
r |
Status of the TCP server |
Signals¶
- Inherited:
Name |
Short Description |
|---|---|
Fields¶
- Inherited:
Name |
Type |
Access |
Description |
|---|---|---|---|
parent |
r |
Class Details¶
- class Infinityd.TcpServer(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
- bind()¶
- Raises:
- Returns:
- Return type:
Binds the server to the address and port given by the
Infinityd.TcpServer:local-addressandInfinityd.TcpServer:local-portproperties. If the former isNone, it will bind on all interfaces on IPv4. If the latter is 0, a random available port will be assigned. If the function fails,Falseis returned and an error is set.self must be in
Infinityd.TcpServerStatus.CLOSEDstate for this function to be called.
- close()¶
Closes a TCP server that is open or bound.
- get_keepalive()¶
- Returns:
A
Infinity.Keepaliverepresenting the keepalive configuration for accepted connections, owned by self.- Return type:
Obtains the current keepalive settings for accepted connections.
- open()¶
- Raises:
- Returns:
- Return type:
Attempts to open self. This means binding its local address and port if not already (see
Infinityd.TcpServer.bind()) and accepting incoming connections.self needs to be in
Infinityd.TcpServerStatus.CLOSEDor %INFD_TCP_SERVER_BOUND status for this function to be called. If self's status isInfinityd.TcpServerStatus.CLOSED, thenInfinityd.TcpServer.bind() is called before actually opening the server.
- set_keepalive(keepalive)¶
- Parameters:
keepalive (
Infinity.Keepalive) – The keepalive settings for accepted connections.
Sets the keepalive settings for new connections accepted by the server.
- do_error(error) virtual¶
- Parameters:
error (
GLib.Error) –
- do_new_connection(connection) virtual¶
- Parameters:
connection (
Infinity.TcpConnection) –
Signal Details¶
- Infinityd.TcpServer.signals.error(tcp_server, object)¶
- Signal Name:
error- Flags:
- Parameters:
tcp_server (
Infinityd.TcpServer) – The object which received the signalobject (
GLib.Error) –
- Infinityd.TcpServer.signals.new_connection(tcp_server, object)¶
- Signal Name:
new-connection- Flags:
- Parameters:
tcp_server (
Infinityd.TcpServer) – The object which received the signalobject (
Infinity.TcpConnection) –
Property Details¶
- Infinityd.TcpServer.props.io¶
- Name:
io- Type:
- Default Value:
- Flags:
I/O handler
- Infinityd.TcpServer.props.keepalive¶
- Name:
keepalive- Type:
- Default Value:
- Flags:
Keepalive settings for accepted connections
- Infinityd.TcpServer.props.local_address¶
- Name:
local-address- Type:
- Default Value:
- Flags:
Address to bind to
- Infinityd.TcpServer.props.local_port¶
-
Port to bind to
- Infinityd.TcpServer.props.status¶
- Name:
status- Type:
- Default Value:
- Flags:
Status of the TCP server