Re: Setting TCP parameters for Socket?



On 27/10/11 17:48, markspace wrote:
Socket sock = new Socket( hostname, port );
sock.setSoTimeout( 6000 ); // too late!

There's no way that I can see to change the time out of the initial connection, which occurs in the first line above, in the constructor. You can set the time out for subsequent reads, but not the first connect.

Is anything stopping you from created an unconnected Socket, then calling connect() on it, with the timeout specified as an argument?

You could also try setSoTimeout() between the constructor and connect(), but it appears to be for reads, not necessarily connects. Of course, that might be the only way for other socket options.

--
ss at comp dot lancs dot ac dot uk

.



Relevant Pages

  • Re: Schematics & standards
    ... schematics. ... which is to use a dot for a connection and no dot for ... no connection, rather than the clumsy "loop" to indicate one wire ... For junction transistors they are incorrect, I agree, but I have become ...
    (sci.electronics.repair)
  • Re: Schematics & standards
    ... schematics. ... which is to use a dot for a connection and no dot for ... no connection, rather than the clumsy "loop" to indicate one wire ... I disagree about those offsets for connecting wires. ...
    (sci.electronics.repair)
  • Re: Displaying Electrical Connections on Two Wires
    ... When I wrote that, I was using Visio ... which does not include the electrical stencils. ... dot and a multi-branch dot pair. ... it doesn't automatically add connection dots. ...
    (microsoft.public.visio)
  • Re: OT Kinda! Reflections connection to VMS :-)
    ... I am making a connection to multiple OpenVMS boxes and the firewall has an idle connection killer that is really aggressive. ... With PuTTY I can set keep alives for once a minute and I am OK, but for the life of me with Reflection V11.0 I can not find a similar setting. ... Ken & Ann Fairfield ... Ken dot And dot Ann ...
    (comp.os.vms)
  • Re: Schematics & standards
    ... schematics. ... which is to use a dot for a connection and no dot for ... no connection, rather than the clumsy "loop" to indicate one wire ... has a committee come up with some cool new way to write ...
    (sci.electronics.repair)