예제 #1
0
 //Class constructor
 //takes for arguments:
 //
 //'messageCallbacks': An array containing definitions of the MessageHandle delegate,
 //one for each client, therefore, the lenght of this array will determine the amount
 //of client connections the server will receive.
 //
 //'newConnectionCallback': A definition of the ConnectionHandle delegate. This method
 //should take care of every client connection received.
 //
 //'PORT': Is number of port the server will be listening to for new connections.
 public Server(MessageHandle[] messageCallbacks, ConnectionHandle newConnectionCallback, int PORT)
 {
     this.messageCallbacks = messageCallbacks;
     this.newConnectionCallback = newConnectionCallback;
     server = new TcpListener(PORT);
     totalClients = messageCallbacks.Length;
     serverThread = new Thread(Run);
     serverThread.IsBackground = true;
     isOnline = false;
 }
예제 #2
0
 public static extern int ldap_get_option_int([In] ConnectionHandle ldapHandle, [In] LdapOption option, ref int outValue);
예제 #3
0
 public static partial int ldap_bind_s(ConnectionHandle ldapHandle, string dn, in SEC_WINNT_AUTH_IDENTITY_EX credentials, BindMethod method);
예제 #4
0
 public static extern int ldap_compare([In] ConnectionHandle ldapHandle, string dn, string attributeName, berval binaryValue, IntPtr servercontrol, IntPtr clientcontrol, ref int messageNumber);
예제 #5
0
 public static extern int ldap_get_option_secInfo([In] ConnectionHandle ldapHandle, [In] LdapOption option, [In, Out] SecurityPackageContextConnectionInformation outValue);
예제 #6
0
 public static extern IntPtr ldap_next_reference([In] ConnectionHandle ldapHandle, [In] IntPtr result);
예제 #7
0
 public static extern int ldap_delete_ext([In] ConnectionHandle ldapHandle, string dn, IntPtr servercontrol, IntPtr clientcontrol, ref int messageNumber);
예제 #8
0
 public static extern int ldap_parse_result_referral([In] ConnectionHandle ldapHandle, [In] IntPtr result, IntPtr serverError, IntPtr dn, IntPtr message, ref IntPtr referral, IntPtr control, byte freeIt);
예제 #9
0
 public static extern int ldap_parse_extended_result([In] ConnectionHandle ldapHandle, [In] IntPtr result, ref IntPtr oid, ref IntPtr data, byte freeIt);
예제 #10
0
 public static extern int ldap_set_option_referral([In] ConnectionHandle ldapHandle, [In] LdapOption option, ref LdapReferralCallback outValue);
예제 #11
0
 public static extern int ldap_start_tls(ConnectionHandle ldapHandle, ref int ServerReturnValue, ref IntPtr Message, IntPtr ServerControls, IntPtr ClientControls);
예제 #12
0
 public static extern int ldap_set_option_ptr([In] ConnectionHandle ldapHandle, [In] LdapOption option, ref IntPtr inValue);
예제 #13
0
 public static extern int ldap_set_option_int([In] ConnectionHandle ld, [In] LdapOption option, ref int inValue);
예제 #14
0
 public static extern int ldap_set_option_servercert([In] ConnectionHandle ldapHandle, [In] LdapOption option, VERIFYSERVERCERT outValue);
예제 #15
0
        public static IConnectionHandle GetConnection(string connectionString, string dbType)
        {
            DbProviderFactory factory;
            DbConnection connection;
            ConnectionHandle handle;

            try
            {
                factory = GetFactory(dbType);
            }
            catch (Exception exception)
            {
                throw new Exception("DB: " + dbType, exception);
            }

            connection = factory.CreateConnection();
            connection.ConnectionString = connectionString;

            handle = new ConnectionHandle(connection, factory);

            return handle;
        }
예제 #16
0
 public static extern int ldap_parse_reference([In] ConnectionHandle ldapHandle, [In] IntPtr result, ref IntPtr referrals, IntPtr ServerControls, byte freeIt);
예제 #17
0
 public static extern int ldap_set_option_clientcert([In] ConnectionHandle ldapHandle, [In] LdapOption option, QUERYCLIENTCERT outValue);
예제 #18
0
 internal static extern int ldap_sasl_interactive_bind([In] ConnectionHandle ld, string dn, string mechanism, IntPtr serverctrls, IntPtr clientctrls, uint flags, [MarshalAs(UnmanagedType.FunctionPtr)] LDAP_SASL_INTERACT_PROC proc, IntPtr defaults);
예제 #19
0
 public static extern int ldap_abandon([In] ConnectionHandle ldapHandle, [In] int messagId);
예제 #20
0
 public static extern int ldap_simple_bind([In] ConnectionHandle ld, string who, string passwd);
예제 #21
0
 public static extern int ldap_rename([In] ConnectionHandle ldapHandle, string dn, string newRdn, string newParentDn, int deleteOldRdn, IntPtr servercontrol, IntPtr clientcontrol, ref int messageNumber);
예제 #22
0
 public static extern int ldap_bind_s([In] ConnectionHandle ld, string who, string passwd, int method);
예제 #23
0
 public static extern IntPtr ldap_get_dn([In] ConnectionHandle ldapHandle, [In] IntPtr result);
예제 #24
0
 public static extern int ldap_extended_operation([In] ConnectionHandle ldapHandle, string oid, berval data, IntPtr servercontrol, IntPtr clientcontrol, ref int messageNumber);
예제 #25
0
 public static extern int ldap_get_option_sechandle([In] ConnectionHandle ldapHandle, [In] LdapOption option, ref SecurityHandle outValue);
예제 #26
0
 public static extern IntPtr ldap_first_attribute([In] ConnectionHandle ldapHandle, [In] IntPtr result, ref IntPtr address);
예제 #27
0
 private int GetInfoInt32Unhandled(ODBC32.SQL_INFO infotype)
 {
     byte[] buffer = new byte[4];
     ConnectionHandle.GetInfo1(infotype, buffer);
     return(BitConverter.ToInt32(buffer, 0));
 }
예제 #28
0
 public static extern int ldap_create_sort_control(ConnectionHandle handle, IntPtr keys, byte critical, ref IntPtr control);
예제 #29
0
 public static partial int ldap_connect(ConnectionHandle ldapHandle, in LDAP_TIMEVAL timeout);
예제 #30
0
 public static extern IntPtr ldap_next_attribute([In] ConnectionHandle ldapHandle, [In] IntPtr result, [In, Out] IntPtr address);
예제 #31
0
		static UtilityHandle()
		{
			UtilityHandle.handle = new ConnectionHandle();
		}
예제 #32
0
 public static extern IntPtr ldap_next_entry([In] ConnectionHandle ldapHandle, [In] IntPtr result);
예제 #33
0
        private static DbParameter[] CreateParameters(ConnectionHandle connection, object[] parameterValues)
        {
            DbParameter[] parameters = new DbParameter[0];

            if (parameterValues != null)
            {
                parameters = new DbParameter[parameterValues.Length];
                for (int i = 0; i < parameterValues.Length; i++)
                {
                    object paramValue = parameterValues[i];

                    //Datetime mapping
                    if (paramValue is DateTime && DateTime.MinValue.Equals((DateTime)paramValue)) paramValue = DBNull.Value;
                    //null mapping
                    if (paramValue == null) paramValue = DBNull.Value;

                    DbParameter parameter = connection.Factory.CreateParameter();
                    parameter.ParameterName = "prm" + i;
                    parameter.Value = paramValue;

                    parameters[i] = parameter;
                }
            }
            return parameters;
        }
예제 #34
0
 public static extern int ldap_search([In] ConnectionHandle ldapHandle, string dn, int scope, string filter, IntPtr attributes, bool attributeOnly, IntPtr servercontrol, IntPtr clientcontrol, int timelimit, int sizelimit, ref int messageNumber);