1

My application needs to write a short packet of data periodically to a group of TCP connections, each of which is encapsulated by an NSFileHandle. NSFileHandle offers asynchronous reading, but for writing, I think I have to use writeData (my Objective-C implementation, GNUStep, does not have the writeabilityHandler property, unfortunately).

My question is: will writeData throw an exception if the TCP file descriptor is not ready for writing, or will it block indefinitely? I've been trying to test this, but it's hard to get the other side of the connection in the proper state. The ideal thing for me would be if writeData would throw an exception, so I could try writing again later.

David Lobron
  • 1,039
  • 2
  • 12
  • 21

0 Answers0