0

i'm creating org.apache.http.config.SocketConfig class to configure my HttpClient,

in org.apache.http.config.SocketConfig api doc,

description of isSoReuseAddress() say, "Determines the default value of the SocketOptions.SO_REUSEADDR parameter for newly created sockets"

as far as i know, so_reuseadd is server side time_wait socket reusing option,

but apache HttpClient is http client, why this method exist??

leesh
  • 1
  • 1
  • 1
    No reason why you can't use it at the client as well. Not very useful, or at least rarely used, but it's possible. – user207421 Feb 03 '20 at 05:02
  • bind() is needed? when so_reuseaddr used by 'Not very useful or at least rerely' manner?? in client side? – leesh Feb 03 '20 at 05:15
  • `bind()` isn't normally needed on the client side, as it happens automatically on `connect()`, but people are sometimes forced to do it anyway by idiotic outbound firewall rules that accomplish nothing. In those circumstances you have to bind to a specific local port, and you may have to use SO_REUSEADDR to make it possible. – user207421 Feb 03 '20 at 05:21
  • really good answer thank you i've learned new information – leesh Feb 03 '20 at 05:28

0 Answers0