コード例 #1
0
ファイル: TestI.cs プロジェクト: xingx001/ice
            public Dictionary <string, string> getEndpointInfoAsContext(Ice.Current current)
            {
                Debug.Assert(current.Connection != null);
                Dictionary <string, string> ctx = new Dictionary <string, string>();

                Ice.EndpointInfo info = current.Connection.getEndpoint().getInfo();
                ctx["timeout"]  = info.timeout.ToString();
                ctx["compress"] = info.compress ? "true" : "false";
                ctx["datagram"] = info.datagram() ? "true" : "false";
                ctx["secure"]   = info.datagram() ? "true" : "false";
                ctx["type"]     = info.type().ToString();

                IPEndpointInfo?ipinfo = getIPEndpointInfo(info);

                Debug.Assert(ipinfo != null);
                ctx["host"] = ipinfo.host;
                ctx["port"] = ipinfo.port.ToString();

                if (ipinfo is UDPEndpointInfo)
                {
                    UDPEndpointInfo udp = (UDPEndpointInfo)ipinfo;
                    ctx["mcastInterface"] = udp.mcastInterface;
                    ctx["mcastTtl"]       = udp.mcastTtl.ToString();
                }

                return(ctx);
            }
コード例 #2
0
ファイル: TestI.cs プロジェクト: motuii/ice
            public Dictionary<string, string> getEndpointInfoAsContext(Ice.Current c)
            {
                Dictionary<string, string> ctx = new Dictionary<string, string>();
                Ice.EndpointInfo info = c.con.getEndpoint().getInfo();
                ctx["timeout"] = info.timeout.ToString();
                ctx["compress"] = info.compress ? "true" : "false";
                ctx["datagram"] = info.datagram() ? "true" : "false";
                ctx["secure"] = info.datagram() ? "true" : "false";
                ctx["type"] = info.type().ToString();

                Ice.IPEndpointInfo ipinfo = getIPEndpointInfo(info);
                ctx["host"] = ipinfo.host;
                ctx["port"] = ipinfo.port.ToString();

                if (ipinfo is Ice.UDPEndpointInfo)
                {
                    Ice.UDPEndpointInfo udp = (Ice.UDPEndpointInfo)ipinfo;
                    ctx["mcastInterface"] = udp.mcastInterface;
                    ctx["mcastTtl"] = udp.mcastTtl.ToString();
                }

                return ctx;
            }