예제 #1
0
        private BDbMethods(IntPtr pdb, BDbOffsetOf offsetOf, BerkeleyDbType dbType)
        {
            _dbType = dbType;
            _offsetOf = offsetOf;

            foreach (BDbOffsetOfItem offsetOfItem in offsetOf.Db)
            {
                IntPtr funcptr = Marshal.ReadIntPtr(pdb + offsetOfItem.Offset);
                switch (offsetOfItem.Name)
                {
                    case "close":
                        _close = (close)Marshal.GetDelegateForFunctionPointer(funcptr, typeof(close));
                        break;
                    case "cursor":
                        _cursor = (cursor)Marshal.GetDelegateForFunctionPointer(funcptr, typeof(cursor));
                        break;
                    case "del":
                        _del = (del)Marshal.GetDelegateForFunctionPointer(funcptr, typeof(del));
                        break;
                    case "get_pagesize":
                        _get_pagesize = (get_pagesize)Marshal.GetDelegateForFunctionPointer(funcptr, typeof(get_pagesize));
                        break;
                    case "open":
                        _open = (open)Marshal.GetDelegateForFunctionPointer(funcptr, typeof(open));
                        break;
                    case "put":
                        _put = (put)Marshal.GetDelegateForFunctionPointer(funcptr, typeof(put));
                        break;
                    case "set_flags":
                        _set_flags = (set_flags)Marshal.GetDelegateForFunctionPointer(funcptr, typeof(set_flags));
                        break;
                }
            }
        }
예제 #2
0
 private BDbenvMethods(IntPtr pdbenv, BDbOffsetOfCollection offsetOfs)
 {
     foreach (BDbOffsetOfItem offsetOfItem in offsetOfs)
     {
         IntPtr funcptr = Marshal.ReadIntPtr(pdbenv + offsetOfItem.Offset);
         switch (offsetOfItem.Name)
         {
             case "close":
                 _close = (close)Marshal.GetDelegateForFunctionPointer(funcptr, typeof(close));
                 break;
             case "open":
                 _open = (open)Marshal.GetDelegateForFunctionPointer(funcptr, typeof(open));
                 break;
         }
     }
 }
예제 #3
0
    public void Listen(open open1)
    {
        open = open1;


        Array.Resize(ref SckSs, 1);

        SckSs[0] = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);

        SckSs[0].Bind(new IPEndPoint(IPAddress.Parse(LocalIP), SPort));



        SckSs[0].Listen(10);

        SckSWaitAccept();
    }
예제 #4
0
        private BDbenvMethods(IntPtr pdbenv, BDbOffsetOfCollection offsetOfs)
        {
            foreach (BDbOffsetOfItem offsetOfItem in offsetOfs)
            {
                IntPtr funcptr = Marshal.ReadIntPtr(pdbenv + offsetOfItem.Offset);
                switch (offsetOfItem.Name)
                {
                case "close":
                    _close = (close)Marshal.GetDelegateForFunctionPointer(funcptr, typeof(close));
                    break;

                case "open":
                    _open = (open)Marshal.GetDelegateForFunctionPointer(funcptr, typeof(open));
                    break;
                }
            }
        }
예제 #5
0
        private BDbMethods(IntPtr pdb, BDbOffsetOf offsetOf, BerkeleyDbType dbType)
        {
            _dbType   = dbType;
            _offsetOf = offsetOf;

            foreach (BDbOffsetOfItem offsetOfItem in offsetOf.Db)
            {
                IntPtr funcptr = Marshal.ReadIntPtr(pdb + offsetOfItem.Offset);
                switch (offsetOfItem.Name)
                {
                case "close":
                    _close = (close)Marshal.GetDelegateForFunctionPointer(funcptr, typeof(close));
                    break;

                case "cursor":
                    _cursor = (cursor)Marshal.GetDelegateForFunctionPointer(funcptr, typeof(cursor));
                    break;

                case "del":
                    _del = (del)Marshal.GetDelegateForFunctionPointer(funcptr, typeof(del));
                    break;

                case "get_pagesize":
                    _get_pagesize = (get_pagesize)Marshal.GetDelegateForFunctionPointer(funcptr, typeof(get_pagesize));
                    break;

                case "open":
                    _open = (open)Marshal.GetDelegateForFunctionPointer(funcptr, typeof(open));
                    break;

                case "put":
                    _put = (put)Marshal.GetDelegateForFunctionPointer(funcptr, typeof(put));
                    break;

                case "set_flags":
                    _set_flags = (set_flags)Marshal.GetDelegateForFunctionPointer(funcptr, typeof(set_flags));
                    break;
                }
            }
        }