Using POSIX sockets directly has both advantages and disadvantages relative to using them through a higher-level API. See the sysctl man page for details.Īvoid POSIX Sockets and CFSocket on iOS Where Possible However, this flag can be useful for diagnosing and working around misbehaving software. You should not do this in publicly shipping software because this flag affects the behavior of other software on the system.
Note: In OS X, you can also globally change the behavior of all sockets on a particular machine by setting the _keepalive sysctl to a nonzero value.