MySql - fixed problem where socket was not getting closed properly (thanks Steve!)
[mono.git] / mcs / class / ByteFX.Data / mysqlclient / ConnectionString.cs
1 using System;
2 using ByteFX.Data.Common;
3
4 namespace ByteFX.Data.MySqlClient
5 {
6         /// <summary>
7         /// Summary description for MySqlConnectionString.
8         /// </summary>
9         internal sealed class MySqlConnectionString : DBConnectionString
10         {
11                 private bool useCompression;
12
13                 public MySqlConnectionString() 
14                 {
15                         connectLifetime = 0;
16                         pooling = true;
17                         minPoolSize = 0;
18                         maxPoolSize = 100;
19                         connectTimeout = 15;
20                         port = 3306;
21                 }
22
23                 public MySqlConnectionString(string connectString) : base(connectString)
24                 {
25                         connectLifetime = 0;
26                         pooling = true;
27                         minPoolSize = 0;
28                         maxPoolSize = 100;
29                         connectTimeout = 15;
30                         port = 3306;
31                         Parse();
32                 }
33
34                 #region Properties
35                 public bool UseCompression 
36                 {
37                         get { return useCompression; }
38                 }
39                 #endregion
40
41                 protected override void ConnectionParameterParsed(string key, string value)
42                 {
43                         switch (key.ToLower()) 
44                         {
45                                 case "use compression":
46                                 case "compress":
47                                         if (value.ToLower() == "no" || value.ToLower() == "false")
48                                                 useCompression = false;
49                                         else
50                                                 useCompression = true;
51                                         break;
52                         }
53
54                         base.ConnectionParameterParsed(key, value);
55                 }
56
57         }
58 }