Beispiel #1
0
            public ConnectionCreatorOptions Deserialize(global::Omnix.Serialization.RocketPack.RocketPackReader r, int rank)
            {
                if (rank > 256)
                {
                    throw new global::System.FormatException();
                }

                uint propertyCount = r.GetUInt32();

                TcpConnectOptions p_tcpConnectOptions = TcpConnectOptions.Empty;
                TcpAcceptOptions  p_tcpAcceptOptions  = TcpAcceptOptions.Empty;

                for (; propertyCount > 0; propertyCount--)
                {
                    uint id = r.GetUInt32();
                    switch (id)
                    {
                    case 0:
                    {
                        p_tcpConnectOptions = TcpConnectOptions.Formatter.Deserialize(r, rank + 1);
                        break;
                    }

                    case 1:
                    {
                        p_tcpAcceptOptions = TcpAcceptOptions.Formatter.Deserialize(r, rank + 1);
                        break;
                    }
                    }
                }

                return(new ConnectionCreatorOptions(p_tcpConnectOptions, p_tcpAcceptOptions));
            }
Beispiel #2
0
        public ConnectionCreatorOptions(TcpConnectOptions tcpConnectOptions, TcpAcceptOptions tcpAcceptOptions)
        {
            if (tcpConnectOptions is null)
            {
                throw new global::System.ArgumentNullException("tcpConnectOptions");
            }
            if (tcpAcceptOptions is null)
            {
                throw new global::System.ArgumentNullException("tcpAcceptOptions");
            }

            this.TcpConnectOptions = tcpConnectOptions;
            this.TcpAcceptOptions  = tcpAcceptOptions;

            {
                var __h = new global::System.HashCode();
                if (this.TcpConnectOptions != default)
                {
                    __h.Add(this.TcpConnectOptions.GetHashCode());
                }
                if (this.TcpAcceptOptions != default)
                {
                    __h.Add(this.TcpAcceptOptions.GetHashCode());
                }
                __hashCode = __h.ToHashCode();
            }
        }