IDictionary tcpProperties = new Hashtable();
tcpProperties["name"] = "tcpBinary";
tcpProperties["port"] = 8888;
tcpProperties["rejectRemoteRequests"] = false;
tcpProperties["bindTo"] = 外网IP; //注:使用IP地址绑定时将无法使用其它IP地址连接
BinaryClientFormatterSinkProvider tcpClientSinkProvider = new BinaryClientFormatterSinkProvider();
BinaryServerFormatterSinkProvider tcpServerSinkProvider = new BinaryServerFormatterSinkProvider();
tcpServerSinkProvider.TypeFilterLevel = TypeFilterLevel.Full;
TcpChannel tcpChannel = new TcpChannel(tcpProperties,tcpClientSinkProvider,tcpServerSinkProvider);
tcpProperties["name"] = "tcpBinary";
tcpProperties["port"] = 8888;
tcpProperties["rejectRemoteRequests"] = false;
tcpProperties["bindTo"] = 外网IP; //注:使用IP地址绑定时将无法使用其它IP地址连接
BinaryClientFormatterSinkProvider tcpClientSinkProvider = new BinaryClientFormatterSinkProvider();
BinaryServerFormatterSinkProvider tcpServerSinkProvider = new BinaryServerFormatterSinkProvider();
tcpServerSinkProvider.TypeFilterLevel = TypeFilterLevel.Full;
TcpChannel tcpChannel = new TcpChannel(tcpProperties,tcpClientSinkProvider,tcpServerSinkProvider);
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货