/// <summary>
        /// Initialization constructor
        /// </summary>
        public GenericTDSServerSession(ITDSServer server, uint sessionID, uint packetSize)
        {
            // Save the server
            Server = server;

            // Save session identifier
            SessionID = sessionID;

            // Save packet size
            PacketSize = packetSize;

            // By default encryption is disabled
            Encryption = TDSEncryptionType.Off;

            // First day of the week
            DateFirst = 7;

            // Transaction isolation level
            TransactionIsolationLevel = TransactionIsolationLevelType.ReadCommited;

            // Language
            Language = LanguageType.English;

            // Date format
            DateFormat = DateFormatType.MonthDayYear;

            // Default collation
            Collation = new byte[] { 0x09, 0x04, 0xD0, 0x00, 0x34 };

            // Infinite text size
            TextSize = -1;
        }
Beispiel #2
0
        /// <summary>
        /// Initialization constructor
        /// </summary>
        public ServerEndPointConnection(ITDSServer server, TcpClient connection)
        {
            // Save server
            Server = server;

            // Save TCP connection
            Connection = connection;

            // Configure timeouts
            Connection.ReceiveTimeout = 1000;

            // Create a new TDS server session
            Session = server.OpenSession();

            // Check if local end-point is recognized
            if (Connection.Client.LocalEndPoint is IPEndPoint)
            {
                // Cast to IP end-point
                IPEndPoint endPoint = Connection.Client.LocalEndPoint as IPEndPoint;

                // Update TDS session
                Session.ServerEndPointInfo = new TDSEndPointInfo(endPoint.Address, endPoint.Port, TDSEndPointTransportType.TCP);
            }

            // Check if remote end-point is recognized
            if (Connection.Client.RemoteEndPoint is IPEndPoint)
            {
                // Cast to IP end-point
                IPEndPoint endPoint = Connection.Client.RemoteEndPoint as IPEndPoint;

                // Update server context
                Session.ClientEndPointInfo = new TDSEndPointInfo(endPoint.Address, endPoint.Port, TDSEndPointTransportType.TCP);
            }
        }
Beispiel #3
0
        /// <summary>
        /// Initialization constructor
        /// </summary>
        /// <param name="server">TDS server instance that will process requests</param>
        public ServerEndPointHandler(ITDSServer server)
        {
            // Prepare connections container
            Connections = new List <T>();

            // Save server instance
            TDSServer = server;
        }
        /// <summary>
        /// Server TDS parser initialization constructor
        /// </summary>
        public TDSServerParser(ITDSServer server, ITDSServerSession session, Stream stream) :
            base(stream)
        {
            // Save TDS server
            Server = server;

            // Save session
            Session = session;

            // Configure TDS server
            Transport.PacketSize        = session.PacketSize;
            Transport.OutgoingSessionID = (ushort)session.SessionID;
        }
Beispiel #5
0
        /// <summary>
        /// Server TDS parser initialization constructor
        /// </summary>
        public TDSServerParser(ITDSServer server, ITDSServerSession session, Stream stream) :
            base(stream)
        {
            // Save TDS server
            Server = server;

            // Save session
            Session = session;

            // Configure TDS server
            Transport.PacketSize = session.PacketSize;
            Transport.OutgoingSessionID = (ushort)session.SessionID;
        }
 /// <summary>
 /// Initialization constructor
 /// </summary>
 public GenericTDSServerSession(ITDSServer server, uint sessionID) :
     this(server, sessionID, 4096)
 {
 }
Beispiel #7
0
 public TDSServerEndPointConnection(ITDSServer server, TcpClient connection)
     : base(server, connection)
 {
 }
Beispiel #8
0
 public TDSServerEndPoint(ITDSServer server)
     : base(server)
 {
 }
        /// <summary>
        /// Initialization constructor
        /// </summary>
        public GenericTDSServerSession(ITDSServer server, uint sessionID, uint packetSize)
        {
            // Save the server
            Server = server;

            // Save session identifier
            SessionID = sessionID;

            // Save packet size
            PacketSize = packetSize;

            // By default encryption is disabled
            Encryption = TDSEncryptionType.Off;

            // First day of the week
            DateFirst = 7;

            // Transaction isolation level
            TransactionIsolationLevel = TransactionIsolationLevelType.ReadCommited;

            // Language
            Language = LanguageType.English;

            // Date format
            DateFormat = DateFormatType.MonthDayYear;

            // Default collation
            Collation = new byte[] { 0x09, 0x04, 0xD0, 0x00, 0x34 };

            // Infinite text size
            TextSize = -1;
        }
 /// <summary>
 /// Initialization constructor
 /// </summary>
 public GenericTDSServerSession(ITDSServer server, uint sessionID) :
     this(server, sessionID, 4096)
 {
 }
        /// <summary>
        /// Initialization constructor
        /// </summary>
        public ServerEndPointConnection(ITDSServer server, TcpClient connection)
        {
            // Save server
            Server = server;

            // Save TCP connection
            Connection = connection;

            // Configure timeouts
            Connection.ReceiveTimeout = 1000;

            // Create a new TDS server session
            Session = server.OpenSession();

            // Check if local end-point is recognized
            if (Connection.Client.LocalEndPoint is IPEndPoint)
            {
                // Cast to IP end-point
                IPEndPoint endPoint = Connection.Client.LocalEndPoint as IPEndPoint;

                // Update TDS session
                Session.ServerEndPointInfo = new TDSEndPointInfo(endPoint.Address, endPoint.Port, TDSEndPointTransportType.TCP);
            }

            // Check if remote end-point is recognized
            if (Connection.Client.RemoteEndPoint is IPEndPoint)
            {
                // Cast to IP end-point
                IPEndPoint endPoint = Connection.Client.RemoteEndPoint as IPEndPoint;

                // Update server context
                Session.ClientEndPointInfo = new TDSEndPointInfo(endPoint.Address, endPoint.Port, TDSEndPointTransportType.TCP);
            }
        }
 public TDSServerEndPointConnection(ITDSServer server, TcpClient connection)
     : base(server, connection)
 {
 }