diff options
author | Palaniappan N <npalani@mono-cvs.ximian.com> | 2007-12-05 09:49:42 +0300 |
---|---|---|
committer | Palaniappan N <npalani@mono-cvs.ximian.com> | 2007-12-05 09:49:42 +0300 |
commit | 269fbcc56b627103e21ce7487d00cf5551d77103 (patch) | |
tree | 686494d9b27b0437e9ae2092993a087d6b68bf1a /mcs/class/Novell.Directory.Ldap | |
parent | 4ac01e4c96638ddcd90690be7b33434c174e0ff9 (diff) |
New Excetion has been thrown incase of connection failure.
svn path=/trunk/mcs/; revision=90732
Diffstat (limited to 'mcs/class/Novell.Directory.Ldap')
-rw-r--r-- | mcs/class/Novell.Directory.Ldap/Novell.Directory.Ldap/Connection.cs | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/mcs/class/Novell.Directory.Ldap/Novell.Directory.Ldap/Connection.cs b/mcs/class/Novell.Directory.Ldap/Novell.Directory.Ldap/Connection.cs index e9df5a92fe5..908bd854660 100644 --- a/mcs/class/Novell.Directory.Ldap/Novell.Directory.Ldap/Connection.cs +++ b/mcs/class/Novell.Directory.Ldap/Novell.Directory.Ldap/Connection.cs @@ -951,18 +951,30 @@ namespace Novell.Directory.Ldap /* package */ internal void writeMessage(Message info) { + ExceptionMessages em = new ExceptionMessages(); + System.Object [][]contents = em.getContents(); messages.Add(info); // For bind requests, if not connected, attempt to reconnect if (info.BindRequest && (Connected == false) && ((System.Object) host != null)) { connect(host, port, info.MessageID); } - LdapMessage msg = info.Request; - writeMessage(msg); - return ; + if(Connected == true) + { + LdapMessage msg = info.Request; + writeMessage(msg); + return ; + } + else + { + int errorCount=0; + for(errorCount=0;errorCount<contents.Length;errorCount++) + if(contents[errorCount][0] == "CONNECTION_CLOSED") + break; + throw new LdapException(ExceptionMessages.CONNECTION_CLOSED, new System.Object[]{host, port}, LdapException.CONNECT_ERROR, (String)contents[errorCount][1]); + } } - /// <summary> Writes an LdapMessage to the Ldap server over a socket. /// /// </summary> |