#[repr(C)]
pub struct aws_websocket_client_connection_options {
Show 17 fields pub allocator: *mut aws_allocator, pub bootstrap: *mut aws_client_bootstrap, pub socket_options: *const aws_socket_options, pub tls_options: *const aws_tls_connection_options, pub proxy_options: *const aws_http_proxy_options, pub host: aws_byte_cursor, pub port: u16, pub handshake_request: *mut aws_http_message, pub initial_window_size: usize, pub user_data: *mut c_void, pub on_connection_setup: aws_websocket_on_connection_setup_fn, pub on_connection_shutdown: aws_websocket_on_connection_shutdown_fn, pub on_incoming_frame_begin: aws_websocket_on_incoming_frame_begin_fn, pub on_incoming_frame_payload: aws_websocket_on_incoming_frame_payload_fn, pub on_incoming_frame_complete: aws_websocket_on_incoming_frame_complete_fn, pub manual_window_management: bool, pub requested_event_loop: *mut aws_event_loop,
}
Expand description

Options for creating a websocket client connection.

Fields

allocator: *mut aws_allocator

Required. Must outlive the connection.

bootstrap: *mut aws_client_bootstrap

Required. Must outlive the connection.

socket_options: *const aws_socket_options

Required. aws_websocket_client_connect() makes a copy.

tls_options: *const aws_tls_connection_options

Optional. aws_websocket_client_connect() deep-copies all contents except the aws_tls_ctx, which must outlive the the connection.

proxy_options: *const aws_http_proxy_options

Optional Configuration options related to http proxy usage.

host: aws_byte_cursor

Required. aws_websocket_client_connect() makes a copy.

port: u16

Optional. Defaults to 443 if tls_options is present, 80 if it is not.

handshake_request: *mut aws_http_message

Required. The request must outlive the handshake process (it will be safe to release in on_connection_setup()) Suggestion: create via aws_http_message_new_websocket_handshake_request()

The method MUST be set to GET. The following headers are required (replace values in []):

Host: [server.example.com] Upgrade: websocket Connection: Upgrade Sec-WebSocket-Key: [dGhlIHNhbXBsZSBub25jZQ==] Sec-WebSocket-Version: 13

Sec-Websocket-Key should be a random 16 bytes value, Base64 encoded.

initial_window_size: usize

Initial window size for websocket. Required. Set to 0 to prevent any incoming websocket frames until aws_websocket_increment_read_window() is called.

user_data: *mut c_void

User data for callbacks. Optional.

on_connection_setup: aws_websocket_on_connection_setup_fn

Called when connect completes. Required. If unsuccessful, error_code will be set, connection will be NULL, and the on_connection_shutdown callback will never be called. If successful, the user is now responsible for the websocket and must call aws_websocket_release() when they are done with it.

on_connection_shutdown: aws_websocket_on_connection_shutdown_fn

Called when connection has finished shutting down. Optional. Never called if on_connection_setup reported failure. Note that the connection is not completely done until on_connection_shutdown has been called AND aws_websocket_release() has been called.

on_incoming_frame_begin: aws_websocket_on_incoming_frame_begin_fn

Called when each new frame arrives. Optional. See aws_websocket_on_incoming_frame_begin_fn.

on_incoming_frame_payload: aws_websocket_on_incoming_frame_payload_fn

Called repeatedly as payload data arrives. Required if on_incoming_frame_begin is set. See aws_websocket_on_incoming_frame_payload_fn.

on_incoming_frame_complete: aws_websocket_on_incoming_frame_complete_fn

Called when done processing an incoming frame. Required if on_incoming_frame_begin is set. See aws_websocket_on_incoming_frame_complete_fn.

manual_window_management: bool

Set to true to manually manage the read window size.

If this is false, the connection will maintain a constant window size.

If this is true, the caller must manually increment the window size using aws_websocket_increment_read_window(). If the window is not incremented, it will shrink by the amount of payload data received. If the window size reaches 0, no further data will be received.

requested_event_loop: *mut aws_event_loop

Optional If set, requests that a specific event loop be used to seat the connection, rather than the next one in the event loop group. Useful for serializing all io and external events related to a client onto a single thread.

Trait Implementations

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
Returns the “default value” for a type. Read more
This method tests for self and other values to be equal, and is used by ==. Read more
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.