private static ClientChannel CreateTcpChannel(Runtime runtime) { // ANCHOR: create_tcp_channel var decodeLevel = new DecodeLevel(); var channel = ClientChannel.CreateTcp(runtime, "127.0.0.1:502", 1, new RetryStrategy(), decodeLevel); // ANCHOR_END: create_tcp_channel return(channel); }
private static ClientChannel CreateTlsChannel(Runtime runtime, TlsClientConfig tlsConfig) { // ANCHOR: create_tls_channel var decodeLevel = new DecodeLevel(); var channel = ClientChannel.CreateTls(runtime, "127.0.0.1:802", 100, new RetryStrategy(), tlsConfig, decodeLevel); // ANCHOR_END: create_tls_channel return(channel); }
private static Server CreateTlsServer(Runtime runtime, DeviceMap map, TlsServerConfig tlsConfig) { // ANCHOR: tls_server_create var decodeLevel = new DecodeLevel(); var server = Server.CreateTls(runtime, "127.0.0.1:802", 10, map, tlsConfig, new AuthorizationHandler(), decodeLevel); // ANCHOR_END: tls_server_create return(server); }
private static Server CreateRtuServer(Runtime runtime, DeviceMap map) { // ANCHOR: rtu_server_create var decodeLevel = new DecodeLevel(); var server = Server.CreateRtu(runtime, "/dev/ttySIM1", new SerialPortSettings(), map, decodeLevel); // ANCHOR_END: rtu_server_create return(server); }
private static Server CreateTcpServer(Runtime runtime, DeviceMap map) { // ANCHOR: tcp_server_create var decodeLevel = new DecodeLevel(); var server = Server.CreateTcp(runtime, "127.0.0.1:502", 100, map, decodeLevel); // ANCHOR_END: tcp_server_create return(server); }
private static ClientChannel CreateRtuChannel(Runtime runtime) { // ANCHOR: create_rtu_channel var decodeLevel = new DecodeLevel(); var channel = ClientChannel.CreateRtu( runtime, // runtime "/dev/ttySIM0", // path new SerialPortSettings(), // serial settings 1, // max queued requests TimeSpan.FromSeconds(1), // retry delay decodeLevel // decode level ); // ANCHOR_END: create_rtu_channel return(channel); }