Example #1
0
        private AipcConnection Create(ConnectionAttribute connectionAttribute, AipcAttribute aipcAttributes, Socket socket)
        {
            AipcConnection connection;

            switch (connectionAttribute.Protocol.asString)
            {
            case "A":
                connection = new AConnection(this, connectionAttribute, aipcAttributes, socket);
                break;

            case "string":
                connection = new StringConnection(this, connectionAttribute, aipcAttributes, socket);
                break;

            case "raw":
                connection = new RawConnection(this, connectionAttribute, aipcAttributes, socket);
                break;

            case "simple":
                connection = new SimpleConnection(this, connectionAttribute, aipcAttributes, socket);
                break;

            default:
                connectionAttribute.HandleNumber = -1;
                connection = null;
                break;
            }

            if (connectionAttribute.HandleNumber != -1)
            {
                connectionAttribute.HandleNumber = NextHandleNumber();
                AddToRoster(connection);
            }

            return(connection);
        }
Example #2
0
        private AipcConnection Create(ConnectionAttribute connectionAttribute, AipcAttribute aipcAttributes, Socket socket)
        {
            AipcConnection connection;

            switch (connectionAttribute.Protocol.asString)
            {
                case "A":
                    connection = new AConnection(this, connectionAttribute, aipcAttributes, socket);
                    break;
                case "string":
                    connection = new StringConnection(this, connectionAttribute, aipcAttributes, socket);
                    break;
                case "raw":
                    connection = new RawConnection(this, connectionAttribute, aipcAttributes, socket);
                    break;
                case "simple":
                    connection = new SimpleConnection(this, connectionAttribute, aipcAttributes, socket);
                    break;
                default:
                    connectionAttribute.HandleNumber = -1;
                    connection = null;
                    break;
            }

            if (connectionAttribute.HandleNumber != -1)
            {
                connectionAttribute.HandleNumber = NextHandleNumber();
                AddToRoster(connection);
            }

            return connection;
        }