Example #1
0
 /// <summary>
 /// Creates a new client to connect to a server using an end point.
 /// </summary>
 /// <param name="endpoint">End point of the server to connect it</param>
 /// <returns>Created TCP client</returns>
 public static IScsClient CreateClient(ScsEndPoint endpoint)
 {
     return(endpoint.CreateClient());
 }
Example #2
0
 /// <summary>
 /// Creates a client to connect to a SCS service.
 /// </summary>
 /// <typeparam name="T">Type of service interface for remote method call</typeparam>
 /// <param name="endpoint">EndPoint of the server</param>
 /// <param name="clientObject">Client-side object that handles remote method calls from server to client.
 /// May be null if client has no methods to be invoked by server</param>
 /// <returns>Created client object to connect to the server</returns>
 public static IScsServiceClient <T> CreateClient <T>(ScsEndPoint endpoint, object clientObject = null) where T : class
 {
     return(new ScsServiceClient <T>(endpoint.CreateClient(), clientObject));
 }
 /// <summary>
 /// Creates a new client to connect to a server using an end point.
 /// </summary>
 /// <param name="endpoint">End point of the server to connect it</param>
 /// <returns>Created TCP client</returns>
 public static IScsClient CreateClient(ScsEndPoint endpoint) => endpoint.CreateClient();
Example #4
0
 /// <summary>
 /// Creates a new client to connect to a server using an end point.
 /// </summary>
 /// <param name="endpoint">End point of the server to connect it</param>
 /// <returns>Created TCP client</returns>
 public static IScsClient CreateClient(ScsEndPoint endpoint, TimeSpan pingTimeout)
 {
     return(endpoint.CreateClient(pingTimeout.Seconds <= 0?30000:pingTimeout.Seconds));
 }
Example #5
0
 /// <summary>
 /// Creates a client to connect to a SCS service.
 /// </summary>
 /// <typeparam name="T">Type of service interface for remote method call</typeparam>
 /// <param name="endpoint">EndPoint of the server</param>
 /// <param name="clientObject">Client-side object that handles remote method calls from server to client.
 /// May be null if client has no methods to be invoked by server</param>
 /// <returns>Created client object to connect to the server</returns>
 public static IScsServiceClient <T> CreateClient <T>(ScsEndPoint endpoint, TimeSpan pingTimeout = default(TimeSpan), object clientObject = null) where T : class
 {
     return(new ScsServiceClient <T>(endpoint.CreateClient(pingTimeout.Seconds <= 0?30000:pingTimeout.Seconds), clientObject));
 }