osx - triggering kevent by force -


I am using kqueue for socket synchronization in OS X. I can register an incident of interest like:

Structure Pest Changes; EV_SET (and replace, connect_set, EVFILT_READ, EV_ADD, 0, NULL, NULL); Kevent (k_queue_, & amp; nbsp; changes, 1, zero, 0, zero);

And the question is, is there a way to trigger this incident with force so that the wait-call will return?

  • shutdown (2) Code> The reading side of that socket - You will get the flag (silly) in the EV_EOF ,
  • Use the timeout argument and call the same handling < / Li>
  • Use the need to break when you wait.

My question though: Why do you need it?

Editing:

If I understand your comments correctly, then around the edge-trigger behavior ( EV_CLEAR ) for the events you write Looking for ways I believe that the proper way to do this is with un-register your socket EVFILT_WRITE , when you have nothing in the outgoing queue, then Re-register it When data is sent to send it is a bit more work, but how it works Literacy, and you kevent (2) is change and both the results because you do not need any additional system calls. Take a look at this and see how it handles things like this. And you're using non-blocking sockets, right?


Comments

Popular posts from this blog

c# - sqlDecimal to decimal clr stored procedure Unable to cast object of type 'System.Data.SqlTypes.SqlDecimal' to type 'System.IConvertible' -

Calling GetGUIThreadInfo from Outlook VBA -

Obfuscating Python code? -