Thread: [pgsqlclient-checkins] pgsqlclient_10/source/PostgreSql/Data/Protocol PgClientNotificationEventArgs.
Status: Inactive
Brought to you by:
carlosga_fb
Update of /cvsroot/pgsqlclient/pgsqlclient_10/source/PostgreSql/Data/Protocol In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5092/Data/Protocol Modified Files: PgClientNotificationEventArgs.cs PgCodes.cs PgDbClient.cs PgOutputPacket.cs PgResponsePacket.cs PgStatement.cs Log Message: Started the reorganization of the CVS module Index: PgResponsePacket.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/source/PostgreSql/Data/Protocol/PgResponsePacket.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** PgResponsePacket.cs 8 Sep 2005 18:41:55 -0000 1.1 --- PgResponsePacket.cs 9 Sep 2005 21:35:00 -0000 1.2 *************** *** 28,37 **** namespace PostgreSql.Data.Protocol { ! internal class PgResponsePacket : BinaryReader { #region · Fields · ! private char message; ! private Encoding encoding; #endregion --- 28,39 ---- namespace PostgreSql.Data.Protocol { ! internal class PgResponsePacket { #region · Fields · ! private char message; ! private Stream stream; ! private BinaryReader packet; ! private Encoding encoding; #endregion *************** *** 45,62 **** } ! public Encoding Encoding ! { ! get { return this.encoding; } ! set { this.encoding = value; } ! } ! ! public long Length { ! get { return ((MemoryStream)this.BaseStream).Length; } } ! public long Position { ! get { return ((MemoryStream)this.BaseStream).Position; } } --- 47,58 ---- } ! public int Length { ! get { return (int)this.stream.Length; } } ! public int Position { ! get { return (int)this.stream.Position; } } *************** *** 76,114 **** } ! public long Pending { ! get { return this.Length - this.Position; } } ! #endregion ! #region · Constructors · ! public PgResponsePacket() : base(new MemoryStream()) { } ! public PgResponsePacket(byte[] contents) : base(new MemoryStream(contents)) { } ! public PgResponsePacket(char message, byte[] contents) : base(new MemoryStream(contents)) { ! this.message = message; } #endregion ! #region · Stream Methods · ! public void Reset() { ! ((MemoryStream)this.BaseStream).SetLength(0); ! ((MemoryStream)this.BaseStream).Position = 0; } ! public byte[] ToArray() { ! return ((MemoryStream)this.BaseStream).ToArray(); } --- 72,123 ---- } ! public bool IsReadyForQuery { ! get { return (this.Message == PgBackendCodes.READY_FOR_QUERY); } } ! public bool IsCommandComplete ! { ! get { return (this.Message == PgBackendCodes.COMMAND_COMPLETE); } ! } ! public bool IsPortalSuspended ! { ! get { return (this.Message == PgBackendCodes.PORTAL_SUSPENDED); } ! } ! public bool IsNoData { + get { return (this.Message == PgBackendCodes.NODATA); } } ! public bool IsCloseComplete { + get { return (this.Message == PgBackendCodes.CLOSE_COMPLETE); } } ! public bool IsRowDescription { ! get { return (this.Message == PgBackendCodes.ROW_DESCRIPTION); } } #endregion ! #region · Constructors · ! public PgResponsePacket(char message, Encoding encoding, byte[] contents) { ! this.packet = new BinaryReader(new MemoryStream(contents)); ! this.encoding = encoding; ! this.message = message; } ! #endregion ! ! #region · Binary Types · ! ! public byte[] ReadBytes(int count) { ! return this.packet.ReadBytes(count); } *************** *** 117,126 **** #region · String Types · public string ReadNullString() { StringBuilder cString = new StringBuilder(); char c; ! ! while ((c = ReadChar()) != PgCodes.NULL_TERMINATOR ) { cString.Append(c); --- 126,145 ---- #region · String Types · + public char ReadChar() + { + return this.packet.ReadChar(); + } + + public char[] ReadChars(int count) + { + return this.packet.ReadChars(count); + } + public string ReadNullString() { StringBuilder cString = new StringBuilder(); char c; ! ! while ((c = this.packet.ReadChar()) != PgCodes.NULL_TERMINATOR) { cString.Append(c); *************** *** 134,148 **** byte[] buffer = new byte[length]; ! this.Read(buffer, 0, length); return this.encoding.GetString(buffer); } ! public new string ReadString() { ! int length = this.ReadInt(); byte[] buffer = new byte[length]; ! this.Read(buffer, 0, length); return this.encoding.GetString(buffer); --- 153,167 ---- byte[] buffer = new byte[length]; ! this.packet.Read(buffer, 0, length); return this.encoding.GetString(buffer); } ! public string ReadString() { ! int length = this.ReadInt32(); byte[] buffer = new byte[length]; ! this.packet.Read(buffer, 0, length); return this.encoding.GetString(buffer); *************** *** 151,192 **** #endregion ! #region · Numeric Types · ! public short ReadShort() { ! short val = base.ReadInt16(); ! return IPAddress.HostToNetworkOrder(val); } ! public int ReadInt() { ! int val = base.ReadInt32(); ! return IPAddress.HostToNetworkOrder(val); } ! public long ReadLong() { ! return IPAddress.HostToNetworkOrder(base.ReadInt64()); } ! public override float ReadSingle() { ! return BitConverter.ToSingle(BitConverter.GetBytes(this.ReadInt()), 0); } public float ReadCurrency() { ! float val = (float)this.ReadInt(); ! return val/100; } ! public override double ReadDouble() { ! byte[] buffer = BitConverter.GetBytes(this.ReadLong()); ! ! return BitConverter.ToDouble(buffer, 0); } --- 170,219 ---- #endregion ! #region · Boolean Types · ! public bool ReadBoolean() { ! return this.packet.ReadBoolean(); ! } ! #endregion ! ! #region · Numeric Types · ! ! public byte ReadByte() ! { ! return this.packet.ReadByte(); } ! public short ReadInt16() { ! return IPAddress.HostToNetworkOrder(this.packet.ReadInt16()); ! } ! public int ReadInt32() ! { ! return IPAddress.HostToNetworkOrder(this.packet.ReadInt32()); } ! public long ReadInt64() { ! return IPAddress.HostToNetworkOrder(this.packet.ReadInt64()); } ! public float ReadSingle() { ! return BitConverter.ToSingle(BitConverter.GetBytes(this.ReadInt32()), 0); } public float ReadCurrency() { ! float value = (float)this.ReadInt32(); ! return (value / 100); } ! public double ReadDouble() { ! return BitConverter.ToDouble(BitConverter.GetBytes(this.ReadInt64()), 0); } *************** *** 197,205 **** public DateTime ReadDate() { ! int days = this.ReadInt(); ! ! DateTime date = new DateTime(days); ! ! return PgCodes.BASE_DATE.AddDays(days); } --- 224,228 ---- public DateTime ReadDate() { ! return PgCodes.BASE_DATE.AddDays(this.ReadInt32()); } *************** *** 207,215 **** { double intervalTime = this.ReadDouble(); ! int intervalMonth = this.ReadInt(); TimeSpan interval = TimeSpan.FromSeconds(intervalTime); ! return interval.Add(TimeSpan.FromDays(intervalMonth*30)); } --- 230,238 ---- { double intervalTime = this.ReadDouble(); ! int intervalMonth = this.ReadInt32(); TimeSpan interval = TimeSpan.FromSeconds(intervalTime); ! return interval.Add(TimeSpan.FromDays(intervalMonth * 30)); } *************** *** 246,261 **** else { - int[] lengths; - int[] lowerBounds; - // Read number of dimensions ! int dimensions = this.ReadInt(); ! ! // Initialize arrays for lengths and lower bounds ! lengths = new int[dimensions]; ! lowerBounds = new int[dimensions]; // Read flags value ! int flags = this.ReadInt(); if (flags != 0) { --- 269,281 ---- else { // Read number of dimensions ! int dimensions = this.ReadInt32(); + // Create arrays for the lengths and lower bounds + int[] lengths = new int[dimensions]; + int[] lowerBounds = new int[dimensions]; + // Read flags value ! int flags = this.ReadInt32(); if (flags != 0) { *************** *** 264,274 **** // Read array element type ! PgType elementType = PgDbClient.Types[this.ReadInt()]; // Read array lengths and lower bounds for (int i = 0; i < dimensions; i++) { ! lengths[i] = this.ReadInt(); ! lowerBounds[i] = this.ReadInt(); } --- 284,294 ---- // Read array element type ! PgType elementType = PgDbClient.Types[this.ReadInt32()]; // Read array lengths and lower bounds for (int i = 0; i < dimensions; i++) { ! lengths[i] = this.ReadInt32(); ! lowerBounds[i] = this.ReadInt32(); } *************** *** 276,286 **** if (type.SystemType.IsPrimitive) { ! return this.ReadPrimitiveArray(elementType, length, ! dimensions, flags, lengths, lowerBounds); } else { ! return this.ReadNonPrimitiveArray(elementType, length, ! dimensions, flags, lengths, lowerBounds); } } --- 296,304 ---- if (type.SystemType.IsPrimitive) { ! return this.ReadPrimitiveArray(elementType, length, dimensions, flags, lengths, lowerBounds); } else { ! return this.ReadNonPrimitiveArray(elementType, length, dimensions, flags, lengths, lowerBounds); } } *************** *** 296,301 **** for (int i = 0; i < data.Length; i++ ) { ! object elementValue = ReadValue(elementType, elementType.Size); ! data.SetValue(elementValue, i); } --- 314,318 ---- for (int i = 0; i < data.Length; i++ ) { ! data.SetValue(this.ReadValue(elementType, elementType.Size), i); } *************** *** 309,316 **** public PgPoint ReadPoint() { ! double x = this.ReadDouble(); ! double y = this.ReadDouble(); ! ! return new PgPoint(x, y); } --- 326,330 ---- public PgPoint ReadPoint() { ! return new PgPoint(this.ReadDouble(), this.ReadDouble()); } *************** *** 340,344 **** public PgPolygon ReadPolygon() { ! PgPoint[] points = new PgPoint[this.ReadInt()]; for (int i = 0; i < points.Length; i++) --- 354,358 ---- public PgPolygon ReadPolygon() { ! PgPoint[] points = new PgPoint[this.ReadInt32()]; for (int i = 0; i < points.Length; i++) *************** *** 353,357 **** { bool isClosedPath = this.ReadBoolean(); ! PgPoint[] points = new PgPoint[this.ReadInt()]; for (int i = 0; i < points.Length; i++) --- 367,371 ---- { bool isClosedPath = this.ReadBoolean(); ! PgPoint[] points = new PgPoint[this.ReadInt32()]; for (int i = 0; i < points.Length; i++) *************** *** 391,397 **** case PgDataType.Decimal: ! return Decimal.Parse( ! this.ReadString(length), ! NumberFormatInfo.InvariantInfo); case PgDataType.Currency: --- 405,409 ---- case PgDataType.Decimal: ! return Decimal.Parse(this.ReadString(length), NumberFormatInfo.InvariantInfo); case PgDataType.Currency: *************** *** 405,415 **** case PgDataType.Int2: ! return this.ReadShort(); case PgDataType.Int4: ! return this.ReadInt(); case PgDataType.Int8: ! return this.ReadLong(); case PgDataType.Interval: --- 417,427 ---- case PgDataType.Int2: ! return this.ReadInt16(); case PgDataType.Int4: ! return this.ReadInt32(); case PgDataType.Int8: ! return this.ReadInt64(); case PgDataType.Interval: *************** *** 494,526 **** case PgDataType.Decimal: ! return Decimal.Parse( ! stringValue, ! NumberFormatInfo.InvariantInfo); case PgDataType.Currency: case PgDataType.Float: ! return Single.Parse( ! stringValue, ! NumberFormatInfo.InvariantInfo); case PgDataType.Double: ! return Double.Parse( ! stringValue, ! NumberFormatInfo.InvariantInfo); case PgDataType.Int2: ! return Int16.Parse( ! stringValue, ! NumberFormatInfo.InvariantInfo); case PgDataType.Int4: ! return Int32.Parse( ! stringValue, ! NumberFormatInfo.InvariantInfo); case PgDataType.Int8: ! return Int64.Parse( ! stringValue, ! NumberFormatInfo.InvariantInfo); case PgDataType.Interval: --- 506,526 ---- case PgDataType.Decimal: ! return Decimal.Parse(stringValue, NumberFormatInfo.InvariantInfo); case PgDataType.Currency: case PgDataType.Float: ! return Single.Parse(stringValue, NumberFormatInfo.InvariantInfo); case PgDataType.Double: ! return Double.Parse(stringValue, NumberFormatInfo.InvariantInfo); case PgDataType.Int2: ! return Int16.Parse(stringValue, NumberFormatInfo.InvariantInfo); case PgDataType.Int4: ! return Int32.Parse(stringValue, NumberFormatInfo.InvariantInfo); case PgDataType.Int8: ! return Int64.Parse(stringValue, NumberFormatInfo.InvariantInfo); case PgDataType.Interval: *************** *** 556,560 **** default: ! return ReadBytes(length); } } --- 556,560 ---- default: ! return this.packet.ReadBytes(length); } } *************** *** 584,588 **** for (int i = data.GetLowerBound(0); i <= data.GetUpperBound(0); i++) { ! int elementLen = this.ReadInt(); data.SetValue(this.ReadValue(elementType, elementType.Size), i); } --- 584,588 ---- for (int i = data.GetLowerBound(0); i <= data.GetUpperBound(0); i++) { ! int elementLen = this.ReadInt32(); data.SetValue(this.ReadValue(elementType, elementType.Size), i); } *************** *** 620,624 **** { byte[] elementData = null; ! int elementLen = this.ReadInt(); switch (type.DataType) --- 620,624 ---- { byte[] elementData = null; ! int elementLen = this.ReadInt32(); switch (type.DataType) *************** *** 637,649 **** case PgDataType.Int2: ! elementData = BitConverter.GetBytes(this.ReadShort()); break; case PgDataType.Int4: ! elementData = BitConverter.GetBytes(this.ReadInt()); break; case PgDataType.Int8: ! elementData = BitConverter.GetBytes(this.ReadLong()); break; } --- 637,649 ---- case PgDataType.Int2: ! elementData = BitConverter.GetBytes(this.ReadInt16()); break; case PgDataType.Int4: ! elementData = BitConverter.GetBytes(this.ReadInt32()); break; case PgDataType.Int8: ! elementData = BitConverter.GetBytes(this.ReadInt64()); break; } Index: PgDbClient.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/source/PostgreSql/Data/Protocol/PgDbClient.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** PgDbClient.cs 8 Sep 2005 18:41:55 -0000 1.1 --- PgDbClient.cs 9 Sep 2005 21:35:00 -0000 1.2 *************** *** 24,30 **** using System.Net; using System.Net.Sockets; ! ! using Mono.Security.Cryptography; ! using Mono.Security.Protocol.Tls; namespace PostgreSql.Data.Protocol --- 24,28 ---- using System.Net; using System.Net.Sockets; ! using System.Net.Security; namespace PostgreSql.Data.Protocol *************** *** 32,57 **** internal class PgDbClient { - #region · Callbacks · - - public SslConnectionCallback SslConnection - { - get { return this.sslCallback; } - set { this.sslCallback = value; } - } - - public NotificationCallback Notification - { - get { return this.notification; } - set { this.notification = value; } - } - - public InfoMessageCallback InfoMessage - { - get { return this.infoMessage; } - set { this.infoMessage = value; } - } - - #endregion - #region · Static Fields · --- 30,33 ---- *************** *** 193,196 **** --- 169,194 ---- #endregion + #region · Callbacks · + + public SslConnectionCallback SslConnection + { + get { return this.sslCallback; } + set { this.sslCallback = value; } + } + + public NotificationCallback Notification + { + get { return this.notification; } + set { this.notification = value; } + } + + public InfoMessageCallback InfoMessage + { + get { return this.infoMessage; } + set { this.infoMessage = value; } + } + + #endregion + #region · Fields · *************** *** 204,211 **** private Socket socket; private NetworkStream networkStream; ! private SslClientStream sslStream; private BinaryReader receive; private BinaryWriter send; - private PgResponsePacket buffer; private PgConnectionParams settings; private char transactionStatus; --- 202,208 ---- private Socket socket; private NetworkStream networkStream; ! private SslStream secureStream; private BinaryReader receive; private BinaryWriter send; private PgConnectionParams settings; private char transactionStatus; *************** *** 243,249 **** #region · Internal Properties · ! internal SslClientStream SslClientStream { ! get { return this.sslStream; } } --- 240,246 ---- #region · Internal Properties · ! internal SslStream SecureStream { ! get { return this.secureStream; } } *************** *** 262,266 **** #region · Constructors · ! public PgDbClient() : this(null) { } --- 259,264 ---- #region · Constructors · ! public PgDbClient() ! : this(null) { } *************** *** 269,273 **** { this.parameterStatus = new Hashtable(); - this.buffer = new PgResponsePacket(); this.settings = settings; --- 267,270 ---- *************** *** 297,309 **** if (this.settings.SSL) { ! this.sslStream = new SslClientStream( ! this.networkStream, ! this.settings.ServerName, ! false, ! Mono.Security.Protocol.Tls.SecurityProtocolType.Tls| ! Mono.Security.Protocol.Tls.SecurityProtocolType.Ssl3); ! this.receive = new BinaryReader(this.sslStream); ! this.send = new BinaryWriter(this.sslStream); if (this.SslConnection != null) --- 294,303 ---- if (this.settings.SSL) { ! this.secureStream = new SslStream(this.networkStream, false); ! this.SecureStream.AuthenticateAsClient(this.settings.ServerName); ! ! this.receive = new BinaryReader(this.SecureStream); ! this.send = new BinaryWriter(this.SecureStream); if (this.SslConnection != null) *************** *** 317,323 **** PgOutputPacket packet = new PgOutputPacket(this.settings.Encoding); ! packet.WriteInt(PgCodes.PROTOCOL_VERSION3); packet.WriteNullString("user"); ! packet.WriteNullString(this.settings.UserName); if (settings.Database != null && this.settings.Database.Length > 0) { --- 311,318 ---- PgOutputPacket packet = new PgOutputPacket(this.settings.Encoding); ! packet.Write(PgCodes.PROTOCOL_VERSION3); packet.WriteNullString("user"); ! packet.WriteNullString(this.settings.UserName); ! if (settings.Database != null && this.settings.Database.Length > 0) { *************** *** 325,328 **** --- 320,324 ---- packet.WriteNullString(this.settings.Database); } + packet.WriteNullString("DateStyle"); packet.WriteNullString(PgCodes.DATE_STYLE); *************** *** 332,343 **** this.SendSimplePacket(packet); ! PgResponsePacket response = new PgResponsePacket(); ! // Check if the is ready for Query ! while (response.Message != PgBackendCodes.READY_FOR_QUERY) { response = this.ReceiveResponsePacket(); this.ProcessResponsePacket(response); } } } --- 328,339 ---- this.SendSimplePacket(packet); ! PgResponsePacket response = null; ! do { response = this.ReceiveResponsePacket(); this.ProcessResponsePacket(response); } + while (!response.IsReadyForQuery); } } *************** *** 462,467 **** } ! responsePacket = new PgResponsePacket(type, buffer); ! responsePacket.Encoding = Settings.Encoding; } catch (IOException) --- 458,462 ---- } ! responsePacket = new PgResponsePacket(type, Settings.Encoding, buffer); } catch (IOException) *************** *** 491,496 **** case PgBackendCodes.BACKEND_KEY_DATA: // BackendKeyData ! this.Handle = packet.ReadInt(); ! this.SecretKey = packet.ReadInt(); break; } --- 486,491 ---- case PgBackendCodes.BACKEND_KEY_DATA: // BackendKeyData ! this.Handle = packet.ReadInt32(); ! this.SecretKey = packet.ReadInt32(); break; } *************** *** 515,519 **** { // Authentication response ! int authType = packet.ReadInt(); PgOutputPacket outPacket = new PgOutputPacket(settings.Encoding); --- 510,514 ---- { // Authentication response ! int authType = packet.ReadInt32(); PgOutputPacket outPacket = new PgOutputPacket(settings.Encoding); *************** *** 550,555 **** // Second calculate md5 of password + user string userHash = MD5Authentication.GetMD5Hash( ! settings.Encoding.GetBytes(settings.UserName), ! settings.UserPassword); // Third calculate real MD5 hash --- 545,549 ---- // Second calculate md5 of password + user string userHash = MD5Authentication.GetMD5Hash( ! settings.Encoding.GetBytes(settings.UserName), settings.UserPassword); // Third calculate real MD5 hash *************** *** 630,634 **** private void ProcessNotificationResponse(PgResponsePacket packet) { ! int processID = packet.ReadInt(); string condition = packet.ReadNullString(); string additional = packet.ReadNullString(); --- 624,628 ---- private void ProcessNotificationResponse(PgResponsePacket packet) { ! int processID = packet.ReadInt32(); string condition = packet.ReadNullString(); string additional = packet.ReadNullString(); *************** *** 736,754 **** // Receive response ! PgResponsePacket response = new PgResponsePacket(); ! while (response.Message != PgBackendCodes.READY_FOR_QUERY) { response = this.ReceiveResponsePacket(); this.ProcessResponsePacket(response); } } ! catch (Exception ex) { ! PgResponsePacket response = new PgResponsePacket(); ! while (response.Message != PgBackendCodes.READY_FOR_QUERY) { response = this.ReceiveResponsePacket(); this.ProcessResponsePacket(response); } throw; --- 730,752 ---- // Receive response ! PgResponsePacket response = null; ! ! do { response = this.ReceiveResponsePacket(); this.ProcessResponsePacket(response); } + while (!response.IsReadyForQuery); } ! catch { ! PgResponsePacket response = null; ! ! do { response = this.ReceiveResponsePacket(); this.ProcessResponsePacket(response); } + while (!response.IsReadyForQuery); throw; *************** *** 765,772 **** PgOutputPacket packet = new PgOutputPacket(); ! packet.WriteInt(16); ! packet.WriteInt(PgCodes.CANCEL_REQUEST); ! packet.WriteInt(Handle); ! packet.WriteInt(SecretKey); // Send packet to the server --- 763,770 ---- PgOutputPacket packet = new PgOutputPacket(); ! packet.Write((int)16); ! packet.Write(PgCodes.CANCEL_REQUEST); ! packet.Write(this.Handle); ! packet.Write(this.SecretKey); // Send packet to the server *************** *** 790,794 **** PgOutputPacket packet = new PgOutputPacket(); ! packet.WriteInt(PgCodes.SSL_REQUEST); // Send packet to the server --- 788,792 ---- PgOutputPacket packet = new PgOutputPacket(); ! packet.Write(PgCodes.SSL_REQUEST); // Send packet to the server *************** *** 854,882 **** private void InitializeSocket() { ! IPAddress hostadd = Dns.Resolve(settings.ServerName).AddressList[0]; ! IPEndPoint EPhost = new IPEndPoint(hostadd, settings.ServerPort); ! this.socket = new Socket( ! AddressFamily.InterNetwork, ! SocketType.Stream, ! ProtocolType.Tcp); // Set Receive Buffer size. ! this.socket.SetSocketOption(SocketOptionLevel.Socket, ! SocketOptionName.ReceiveBuffer, settings.PacketSize); // Set Send Buffer size. ! this.socket.SetSocketOption(SocketOptionLevel.Socket, ! SocketOptionName.SendBuffer, settings.PacketSize); ! // Disables the Nagle algorithm for send coalescing. ! this.socket.SetSocketOption( ! SocketOptionLevel.Tcp, ! SocketOptionName.NoDelay, ! 1); // Make the socket to connect to the Server ! this.socket.Connect(EPhost); this.networkStream = new NetworkStream(socket, true); --- 852,870 ---- private void InitializeSocket() { ! IPAddress hostadd = Dns.GetHostEntry(settings.ServerName).AddressList[0]; ! this.socket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp); // Set Receive Buffer size. ! this.socket.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.ReceiveBuffer, settings.PacketSize); // Set Send Buffer size. ! this.socket.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.SendBuffer, settings.PacketSize); // Disables the Nagle algorithm for send coalescing. ! this.socket.SetSocketOption(SocketOptionLevel.Tcp, SocketOptionName.NoDelay, 1); // Make the socket to connect to the Server ! this.socket.Connect(new IPEndPoint(hostadd, settings.ServerPort)); this.networkStream = new NetworkStream(socket, true); *************** *** 895,903 **** { // Close streams ! if (this.sslStream != null) { try { ! this.sslStream.Close(); } catch --- 883,891 ---- { // Close streams ! if (this.secureStream != null) { try { ! this.secureStream.Close(); } catch Index: PgStatement.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/source/PostgreSql/Data/Protocol/PgStatement.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** PgStatement.cs 8 Sep 2005 18:41:55 -0000 1.1 --- PgStatement.cs 9 Sep 2005 21:35:00 -0000 1.2 *************** *** 183,187 **** packet.WriteNullString(this.ParseName); packet.WriteNullString(this.stmtText); ! packet.WriteShort(0); // Send packet to the server --- 183,187 ---- packet.WriteNullString(this.ParseName); packet.WriteNullString(this.stmtText); ! packet.Write((short)0); // Send packet to the server *************** *** 231,241 **** // Receive Describe response ! PgResponsePacket response = new PgResponsePacket(); ! while ((response.Message != PgBackendCodes.ROW_DESCRIPTION && ! response.Message != PgBackendCodes.NODATA)) { response = this.db.ReceiveResponsePacket(); this.ProcessSqlPacket(response); ! } // Update status --- 231,241 ---- // Receive Describe response ! PgResponsePacket response = null; ! do { response = this.db.ReceiveResponsePacket(); this.ProcessSqlPacket(response); ! } ! while (response.IsRowDescription || response.IsNoData); // Update status *************** *** 267,288 **** // Send parameters format code. ! packet.WriteShort((short)parameters.Length); for (int i = 0; i < parameters.Length; i++) { ! packet.WriteShort((short)this.parameters[i].DataType.FormatCode); } // Send parameter values ! packet.WriteShort((short)parameters.Length); for (int i = 0; i < parameters.Length; i++) { ! packet.WriteParameter(this.parameters[i]); } // Send column information ! packet.WriteShort((short)this.rowDescriptor.Fields.Length); for (int i = 0; i < this.rowDescriptor.Fields.Length; i++) { ! packet.WriteShort((short)this.rowDescriptor.Fields[i].DataType.FormatCode); } --- 267,288 ---- // Send parameters format code. ! packet.Write((short)parameters.Length); for (int i = 0; i < parameters.Length; i++) { ! packet.Write((short)this.parameters[i].DataType.FormatCode); } // Send parameter values ! packet.Write((short)parameters.Length); for (int i = 0; i < parameters.Length; i++) { ! packet.Write(this.parameters[i]); } // Send column information ! packet.Write((short)this.rowDescriptor.Fields.Length); for (int i = 0; i < this.rowDescriptor.Fields.Length; i++) { ! packet.Write((short)this.rowDescriptor.Fields[i].DataType.FormatCode); } *************** *** 312,316 **** packet.WriteNullString(this.PortalName); ! packet.WriteInt(this.fetchSize); // Rows to retrieve ( 0 = nolimit ) // Send packet to the server --- 312,316 ---... [truncated message content] |