![]() |
BlackBerry Dynamics for .NET Maui
12.1.1.5
Runtime library for .NET Maui applications
|
TCP socket, supporting SSL/TLS and communication across the firewall. More...
Public Member Functions | |
void | ConnectAsync () |
Connects the socket. More... | |
void | DisconnectAsync () |
Terminates the socket connection. More... | |
Task | DisableHostVerificationAsync () |
Switches off host name verification, when making an SSL/TLS connection. Host name verification is an SSL/TLS security option. More... | |
Task | DisablePeerVerificationAsync () |
Switches off certificate authenticity verification, when making an SSL/TLS connection. Authenticity verification is an SSL/TLS security option. More... | |
Task | WriteAsync (byte[] data) |
Sends data to socket. More... | |
Task< byte[]> | ReadAllAsync () |
Reads all bytes available in the socket. More... | |
Task< byte[]> | ReadAsync () |
Reads some number of bytes available in the socket. More... | |
Properties | |
string | Url [get] |
String containing the address of the server. Can be either an Internet Protocol address (IP address, for example "192.168.1.10"), or a fully qualified domain name (for example "www.example.com"). More... | |
int | Port [get] |
Number of the server port to which the socket will connect. More... | |
int | BufferSize [get] |
The size of buffer into which the data is read. More... | |
bool | IsSecure [get] |
Informs if SSL/TLS security is used. More... | |
bool | IsConnected [get] |
Informs about connection state of the socket. More... | |
bool | IsClosed [get] |
Returns the closed state of the socket. More... | |
bool | IsDataAvailable [get] |
Informs if data has been received from the network and is available to be read. More... | |
Events | |
EventHandler< EventArgs > | Connected |
Socket connected event. More... | |
EventHandler< EventArgs > | Disconnected |
Socket disconnected event. More... | |
EventHandler< EventArgs > | DataReceived |
Socket data received event. More... | |
EventHandler< BBDSocketErrorEventArgs > | ErrorOccurred |
Socket error event. More... | |
TCP socket, supporting SSL/TLS and communication across the firewall.
The BlackBerry Dynamics socket is for bi-directional data communication between the mobile application on the device and an application server. The application server can be on the Internet, or behind the enterprise firewall. Secure Socket Layer and Transport Layer Security (SSL/TLS) are supported.
The functions in this class cannot be called until BlackBerry Dynamics authorization processing is complete.
BlackBerry Dynamics secure communication does not use the proxy specified in the device's native settings, if applicable.
For more information go to BlackBerry Dynamics for iOS and Android.
void BBDXamarinForms.Common.Interfaces.Networking.Sockets.IBBDSocket.ConnectAsync | ( | ) |
Connects the socket.
The connection attempt is asynchronous. If the attempt succeeds, the Connected event is raised.
Task BBDXamarinForms.Common.Interfaces.Networking.Sockets.IBBDSocket.DisableHostVerificationAsync | ( | ) |
Switches off host name verification, when making an SSL/TLS connection. Host name verification is an SSL/TLS security option.
This function must be called before connect.
Switching off host name verification doesn't switch off authenticity verification.
Task BBDXamarinForms.Common.Interfaces.Networking.Sockets.IBBDSocket.DisablePeerVerificationAsync | ( | ) |
Switches off certificate authenticity verification, when making an SSL/TLS connection. Authenticity verification is an SSL/TLS security option.
This function must be called before connect.
Switching off authenticity verification implicitly also switches off host name verification.
void BBDXamarinForms.Common.Interfaces.Networking.Sockets.IBBDSocket.DisconnectAsync | ( | ) |
Terminates the socket connection.
Disconnection is asynchronous. When disconnection completes, the Disconnected event is raised.
Task<byte[]> BBDXamarinForms.Common.Interfaces.Networking.Sockets.IBBDSocket.ReadAllAsync | ( | ) |
Reads all bytes available in the socket.
Task<byte[]> BBDXamarinForms.Common.Interfaces.Networking.Sockets.IBBDSocket.ReadAsync | ( | ) |
Reads some number of bytes available in the socket.
The number of bytes read is, at most, equal to the length of BufferSize.
Task BBDXamarinForms.Common.Interfaces.Networking.Sockets.IBBDSocket.WriteAsync | ( | byte[] | data | ) |
Sends data to socket.
data |
|
get |
The size of buffer into which the data is read.
|
get |
Returns the closed state of the socket.
|
get |
Informs about connection state of the socket.
Closing the socket doesn't clear connection state (this property will return true if the socket was connected).
|
get |
Informs if data has been received from the network and is available to be read.
|
get |
Informs if SSL/TLS security is used.
|
get |
Number of the server port to which the socket will connect.
|
get |
String containing the address of the server. Can be either an Internet Protocol address (IP address, for example "192.168.1.10"), or a fully qualified domain name (for example "www.example.com").
EventHandler<EventArgs> BBDXamarinForms.Common.Interfaces.Networking.Sockets.IBBDSocket.Connected |
Socket connected event.
This event is raised when the corresponding socket opens for communication with the remote server.
Raising of this event also notifies the application on the device that data can be written to the socket.
EventHandler<EventArgs> BBDXamarinForms.Common.Interfaces.Networking.Sockets.IBBDSocket.DataReceived |
Socket data received event.
This event is raised when data has been received from the remote server, and is ready to read.
The received data will be available in the corresponding socket and can be accessed using the ReadAllAsync or ReadAsync methods.
EventHandler<EventArgs> BBDXamarinForms.Common.Interfaces.Networking.Sockets.IBBDSocket.Disconnected |
Socket disconnected event.
This event is raised when the corresponding socket is closed. This means closed by the remote end, or by the client end.
Raising this event notifies the application on the device that:
EventHandler<BBDSocketErrorEventArgs> BBDXamarinForms.Common.Interfaces.Networking.Sockets.IBBDSocket.ErrorOccurred |
Socket error event.
This event is raised when a socket error occurs on the corresponding socket.