GObject.Object
Soup.Socket
Import line: | Soup = imports.gi.Soup; |
GIR File: | Soup-2.4.gir |
C documentation: | SoupSocket |
Class : | Socket |
Extends: | GObject.Object |
Show / Hide Inherited methods, properties and signals |
Properties | Defined By | |
---|---|---|
async_context : void*
|
Soup.Socket | |
is_server : Boolean
read only
|
Soup.Socket | |
local_address : Soup.Address
|
Soup.Socket | |
non_blocking : Boolean
|
Soup.Socket | |
parent : GObject.Object
read only
|
Soup.Socket | |
remote_address : Soup.Address
|
Soup.Socket | |
ssl_creds : void*
|
Soup.Socket | |
ssl_strict : Boolean
|
Soup.Socket | |
timeout : Number
|
Soup.Socket | |
trusted_certificate : Boolean
|
Soup.Socket |
Method / Constructor | Defined By | |
---|---|---|
new Soup.Socket
(Object properties)
Create a new Soup.Socket
Create a new Soup.Socket
|
||
Begins asynchronously connecting to sock's remote address.
Begins asynchronously connecting to sock's remote address. The socket will call callback when it succeeds or fails (but not before returning from this function). If cancellable is non-NULL, it can be used to cancel the connection. callback will still be invoked in this case, with a status of SOUP_STATUS_CANCELLED.
|
Soup.Socket | |
connect_sync
(Cancellable cancellable)
:
Number
Attempt to synchronously connect sock to its remote address.
Attempt to synchronously connect sock to its remote address. If cancellable is non-NULL, it can be used to cancel the connection, in which case soup_socket_connect_sync() will return SOUP_STATUS_CANCELLED.
|
Soup.Socket | |
disconnect
()
:
none
Disconnects sock.
Disconnects sock. Any further read or write attempts on it will fail.
|
Soup.Socket | |
get_fd
()
:
Number
|
Soup.Socket | |
get_local_address
()
:
Soup.Address
Returns the SoupAddress corresponding to the local end of sock.
Returns the SoupAddress corresponding to the local end of sock.
|
Soup.Socket | |
get_remote_address
()
:
Soup.Address
Returns the SoupAddress corresponding to the remote end of sock.
Returns the SoupAddress corresponding to the remote end of sock.
|
Soup.Socket | |
is_connected
()
:
Boolean
Tests if sock is connected to another host
Tests if sock is connected to another host
|
Soup.Socket | |
is_ssl
()
:
Boolean
Tests if sock is set up to do SSL.
Tests if sock is set up to do SSL. Note that this simply means that the SOUP_SOCKET_SSL_CREDENTIALS property has been set; it does not mean that soup_socket_start_ssl() has been called.
|
Soup.Socket | |
listen
()
:
Boolean
listening) Makes sock start listening on its local address.
listening) Makes sock start listening on its local address. When connections come in, sock will emit new_connection.
|
Soup.Socket | |
Attempts to read up to len bytes from sock into buffer.
Attempts to read up to len bytes from sock into buffer. If some data is successfully read, soup_socket_read() will return SOUP_SOCKET_OK, and *nread will contain the number of bytes actually read (which may be less than len). If sock is non-blocking, and no data is available, the return value will be SOUP_SOCKET_WOULD_BLOCK. In this case, the caller can connect to the SoupSocket::readable signal to know when there socket first. SoupSocket::readable is only emitted after soup_socket_read() returns SOUP_SOCKET_WOULD_BLOCK, and it is only emitted once. See the documentation for SoupSocket:non-blocking.) SOUP_SOCKET_EOF if the socket is no longer connected, or SOUP_SOCKET_ERROR on any other error, in which case error will also be set).
|
Soup.Socket | |
read_until
(void* buffer, Number len, void* boundary, Number boundary_len, Object out_values, Boolean got_boundary, Cancellable cancellable)
:
Soup.SocketIOStatus
ends with the boundary string Like soup_socket_read(), but reads no further than the first occurrence of boundary.
ends with the boundary string Like soup_socket_read(), but reads no further than the first occurrence of boundary. (If the boundary is found, it will be included in the returned data, and *got_boundary will be set to TRUE.) Any data after the boundary will returned in future reads. soup_socket_read_until() will almost always return fewer than len up until the end of the boundary, and if the boundary is not found, then it will leave the last
|
Soup.Socket | |
Starts using SSL on socket, expecting to find a host named
Starts using SSL on socket, expecting to find a host named
|
Soup.Socket | |
start_ssl
(Cancellable cancellable)
:
Boolean
Starts using SSL on socket.
Starts using SSL on socket.
|
Soup.Socket | |
Attempts to write len bytes from buffer to sock.
Attempts to write len bytes from buffer to sock. If some data is successfully written, the return status will be SOUP_SOCKET_OK, and *nwrote will contain the number of bytes actually written (which may be less than len). If sock is non-blocking, and no data could be written right away, the return value will be SOUP_SOCKET_WOULD_BLOCK. In this case, the caller can connect to the SoupSocket::writable signal to know emitted after soup_socket_write() returns SOUP_SOCKET_WOULD_BLOCK, and it is only emitted once. See the documentation for SoupSocket:non-blocking.) SOUP_SOCKET_EOF or SOUP_SOCKET_ERROR. error will be set if the return value is SOUP_SOCKET_ERROR.)
|
Soup.Socket |
Event | Defined By | |
---|---|---|
disconnected (Socket self)
:
none
|
Soup.Socket | |
|
Soup.Socket | |
readable (Socket self)
:
none
|
Soup.Socket | |
writable (Socket self)
:
none
|
Soup.Socket |
Class / Namespace | Method / Signal / Properties |
---|---|
Soup.ClientContext
Method |
get_socket
()
:
Soup.Socket
Retrieves the SoupSocket that client is associated with.
|
Soup.Connection
Method |
get_socket
()
:
Soup.Socket
|
Soup.Message
Method |
|
Soup.Message
Method |
read_request
(Socket sock)
:
none
|
Soup.Message
Method |
io_client
(Socket sock, Connection conn, Function get_headers_cb, Function parse_headers_cb, void* user_data)
:
none
|
Soup.Message
Method |
|
Soup.Server
Method |
get_listener
()
:
Soup.Socket
Gets server's listening socket.
|
Soup.Session
Signal |
|