ProtocolServerOpenAsyncT Method (Boolean, OpenParams, ProtocolProperties, ServiceClientAsyncT, CallbackContext) |
Creates a server with defined properties and starts accepting connections, calling 'serviceConnection' with each connection established.
This method returns after the server has been established, leaving the accepting and servicing of connections to a background thread.
Namespace:
Demo3D.Net
Assembly:
Demo3D.IO (in Demo3D.IO.dll) Version: 18.04.00
Syntaxpublic static Task<ServerSocket> OpenAsync<T>(
bool sync,
OpenParams parameters,
ProtocolProperties properties,
ServiceClientAsync<T> serviceConnection,
CallbackContext callbackContext = CallbackContext.CallerContext
)
where T : class
Parameters
- sync
- Type: SystemBoolean
If true, the Task returned is guaranteed to be complete. - parameters
- Type: Demo3D.NetOpenParams
Parameters to open the server socket. - properties
- Type: Demo3D.NetProtocolProperties
Server properties. - serviceConnection
- Type: Demo3D.NetServiceClientAsyncT
Connection service delegate (or null). - callbackContext (Optional)
- Type: Demo3D.NetCallbackContext
Defines the context in which serviceConnection should be called.
Type Parameters
- T
- Required services.
Return Value
Type:
TaskServerSocketThe server socket.
Remarks
If callbackContext is CallerContext then serviceConnection is Demo3D thread safe.
It's called in the same thread (synchronization context) as the caller to this method.
See Also