Use the methodTag(s): Networking

By using the setSoLinger() method, you can explicitly set a delay before a reset is sent, giving more time for data to be read or send, or you can specify a delay of zero, meaning a reset will be sent as soon as the method is invoked. You can possibly increase performance with a delay of zero. Note that if a linger time is set to zero, then any unsent packets are thrown away when the socket is closed otherwise the close() method blocks while waiting the specified number of seconds for the data to be sent, and acknowledgements to be received.

The method accepts as parameters a boolean and an int. The boolean flag activates or deactivates the SO_LINGER option, and the int controls the delay time (in seconds, max 65535).

You get the current "linger" setting with

blog comments powered by Disqus