示例#1
0
        public static dsn_task_t FileWrite(
            dsn_handle_t hFile,
            byte[] buffer,
            int count,
            UInt64 offset,
            TaskCode callbackCode,
            Servicelet callbackOwner,
            AioHandler callback,
            int hash = 0
            )
        {
            int        idx  = GlobalInterOpLookupTable.Put(callback);
            dsn_task_t task = Native.dsn_file_create_aio_task(callbackCode, _c_aio_handler_holder, (IntPtr)idx, hash);

            Native.dsn_file_write(hFile, buffer, count, offset, task, callbackOwner != null ? callbackOwner.tracker() : IntPtr.Zero);
            return(task);
        }
示例#2
0
        public static dsn_task_t CopyRemoteDirectory(
            dsn_address_t remote,
            string source_dir,
            string dest_dir,
            bool overwrite,
            TaskCode callbackCode,
            Servicelet callbackOwner,
            AioHandler callback,
            int hash = 0
            )
        {
            int        idx  = GlobalInterOpLookupTable.Put(callback);
            dsn_task_t task = Native.dsn_file_create_aio_task(callbackCode, _c_aio_handler_holder, (IntPtr)idx, hash);

            Native.dsn_file_copy_remote_directory(remote, source_dir, dest_dir, overwrite, task, callbackOwner != null ? callbackOwner.tracker() : IntPtr.Zero);
            return(task);
        }
示例#3
0
        public static void RpcCallAsync(
            RpcAddress server,
            RpcWriteStream requestStream,
            Servicelet callbackOwner,
            RpcResponseHandler callback,
            int replyHash = 0
            )
        {
            Logging.dassert(requestStream.IsFlushed(),
                            "RpcWriteStream must be flushed after write in the same thread");

            var        idx  = GlobalInterOpLookupTable.Put(callback);
            dsn_task_t task = Native.dsn_rpc_create_response_task(
                requestStream.DangerousGetHandle(),
                _c_rpc_response_handler_holder,
                (IntPtr)idx,
                replyHash
                );

            Native.dsn_rpc_call(server, task, callbackOwner != null ? callbackOwner.tracker() : IntPtr.Zero);
        }
示例#4
0
 public extern static bool        dsn_task_wait_timeout(dsn_task_t task, int timeout_milliseconds);
示例#5
0
 public extern static bool        dsn_task_cancel2(dsn_task_t task, bool wait_until_finished, out bool finished);
示例#6
0
 public extern static void        dsn_task_add_ref(dsn_task_t task);
示例#7
0
文件: NativeCalls.cs 项目: ykwd/rDSN
 public static extern void         dsn_file_copy_remote_directory(dsn_address_t remote, string source_dir, string dest_dir, bool overwrite, dsn_task_t cb);
示例#8
0
文件: NativeCalls.cs 项目: zmyer/rDSN
 public static extern void          dsn_rpc_enqueue_response(dsn_task_t rpc_call, dsn_error_t err, dsn_message_t response);
示例#9
0
文件: NativeCalls.cs 项目: ykwd/rDSN
 public static extern int dsn_task_error(dsn_task_t task);
示例#10
0
 public extern static void         dsn_file_copy_remote_files(dsn_address_t remote, string source_dir, string[] source_files, string dest_dir, bool overwrite, dsn_task_t cb);
示例#11
0
 public extern static void         dsn_file_copy_remote_directory(dsn_address_t remote, string source_dir, string dest_dir, bool overwrite, dsn_task_t cb, dsn_task_tracker_t tracker);
示例#12
0
 public extern static void         dsn_file_write(dsn_handle_t file, byte[] buffer, int count, UInt64 offset, dsn_task_t cb, dsn_task_tracker_t tracker);
示例#13
0
 public extern static void          dsn_rpc_call(dsn_address_t server, dsn_task_t rpc_call, dsn_task_tracker_t tracker);
示例#14
0
 public extern static dsn_error_t dsn_task_error(dsn_task_t task);
示例#15
0
 public extern static bool        dsn_task_cancel(dsn_task_t task, bool wait_until_finished);
示例#16
0
 public extern static void        dsn_task_call(dsn_task_t task, dsn_task_tracker_t tracker, int delay_milliseconds);
示例#17
0
文件: Utils.cs 项目: whiker/rDSN
 public SafeTaskHandle(dsn_task_t nativeHandle)
     : base(nativeHandle, true)
 {
     Native.dsn_task_add_ref(nativeHandle);
 }
示例#18
0
 public extern static void          dsn_rpc_call(dsn_address_t server, dsn_task_t rpc_call);
示例#19
0
 public extern static void          dsn_rpc_enqueue_response(dsn_task_t rpc_call, dsn_error_t err, dsn_message_t response);
示例#20
0
文件: Utils.cs 项目: zmyer/rDSN
 public SafeTaskHandle(dsn_task_t nativeHandle, int callback_index)
     : base(nativeHandle, true)
 {
     _callback_index = callback_index;
     Native.dsn_task_add_ref(nativeHandle);
 }
示例#21
0
 public extern static void         dsn_file_task_enqueue(dsn_task_t cb_task, dsn_error_t err, size_t size);
示例#22
0
文件: NativeCalls.cs 项目: zmyer/rDSN
 public static extern void         dsn_file_copy_remote_files(dsn_address_t remote, string source_dir, string[] source_files, string dest_dir, bool overwrite, dsn_task_t cb);
示例#23
0
文件: NativeCalls.cs 项目: zmyer/rDSN
 public static extern dsn_message_t dsn_rpc_get_response(dsn_task_t rpc_call); // returned msg must be explicitly msg_release_ref
示例#24
0
文件: NativeCalls.cs 项目: zmyer/rDSN
 public static extern void         dsn_file_task_enqueue(dsn_task_t cb_task, dsn_error_t err, size_t size);
示例#25
0
文件: NativeCalls.cs 项目: zmyer/rDSN
 public static extern void         dsn_file_write(dsn_handle_t file, byte[] buffer, int count, UInt64 offset, dsn_task_t cb);
示例#26
0
文件: NativeCalls.cs 项目: ykwd/rDSN
 public static extern void         dsn_file_read(dsn_handle_t file, byte[] buffer, int count, UInt64 offset, dsn_task_t cb);
示例#27
0
文件: NativeCalls.cs 项目: zmyer/rDSN
 public static extern size_t       dsn_file_get_io_size(dsn_task_t cb_task);
示例#28
0
文件: NativeCalls.cs 项目: zmyer/rDSN
 public static extern void        dsn_task_release_ref(dsn_task_t task);
示例#29
0
 public extern static void        dsn_task_release_ref(dsn_task_t task);
示例#30
0
文件: NativeCalls.cs 项目: zmyer/rDSN
 public static extern void        dsn_task_add_ref(dsn_task_t task);
示例#31
0
 public extern static void        dsn_task_call(dsn_task_t task, int delay_milliseconds);
示例#32
0
文件: NativeCalls.cs 项目: zmyer/rDSN
 public static extern void        dsn_task_call(dsn_task_t task, int delay_milliseconds);
示例#33
0
 public extern static bool        dsn_task_wait(dsn_task_t task); 
示例#34
0
文件: NativeCalls.cs 项目: zmyer/rDSN
 public static extern bool        dsn_task_cancel2(dsn_task_t task, bool wait_until_finished, out bool finished);
示例#35
0
 public extern static dsn_error_t dsn_task_error(dsn_task_t task);
示例#36
0
文件: NativeCalls.cs 项目: zmyer/rDSN
 public static extern bool        dsn_task_wait(dsn_task_t task);
示例#37
0
 public extern static dsn_message_t dsn_rpc_get_response(dsn_task_t rpc_call); // returned msg must be explicitly msg_release_ref
示例#38
0
文件: NativeCalls.cs 项目: zmyer/rDSN
 public static extern bool        dsn_task_wait_timeout(dsn_task_t task, int timeout_milliseconds);
示例#39
0
 public extern static void         dsn_file_write(dsn_handle_t file, byte[] buffer, int count, UInt64 offset, dsn_task_t cb);
示例#40
0
文件: NativeCalls.cs 项目: zmyer/rDSN
 public static extern int dsn_task_error(dsn_task_t task);
示例#41
0
 public extern static size_t       dsn_file_get_io_size(dsn_task_t cb_task);
示例#42
0
文件: NativeCalls.cs 项目: zmyer/rDSN
 public static extern void          dsn_rpc_call(dsn_address_t server, dsn_task_t rpc_call);
示例#43
0
 public SafeTaskHandle(dsn_task_t nativeHandle, int callback_index)
     : base(nativeHandle, true)
 {
     _callback_index = callback_index;
     Native.dsn_task_add_ref(nativeHandle);
 }
示例#44
0
文件: NativeCalls.cs 项目: ykwd/rDSN
 public static extern bool        dsn_task_cancel(dsn_task_t task, bool wait_until_finished);