对象句柄

Asio提供以下功能,来保证在句柄上的异步等待事件在内核中实现:

  • Change notification
  • Console input
  • Event
  • Memory resource notification
  • Process
  • Semaphore
  • Thread
  • Waitable timer

例如,要在事件上实现异步操作,这样做:

HANDLE handle = ::CreateEvent(...);
windows::object_handle fiel(my_io_service, handle);

然后成员函数wait或者async_wait会被用到,它们被用来启动wait知道内核对象被signalled。

参见

windows::object_handle, windows::basic_object_handle, windows::object_handle_service

注意

你可以用ASIO_HA S_WINDOWS_OBJECT_HANDLE宏来判定该功能是否可用,不能则会在编译期报错。

results matching ""

    No results matching ""