EldoS
MsgConnect home / Documentation / HttpTransportClient.InactivityTime property
Navigation
Web site
Support
Table Of Contents

Java ME 


HttpTransportClient.InactivityTime

HttpTransportClient     See also    


Specifies how long the inactive connection is kept.

Declaration

[Java ME]
    public void setInactivityTime(long time);
    public long getInactivityTime();

Description

    To increase efficiency of message delivery HttpTransportClient tries to keep the established connection active for some time to avoid reconnecting when reply or next message is to be sent. If message transfer occures all the time, it makes sense to keep the connection -- each connection + disconnection require transfer of 7 TCP packets. Use InactivityTime to specify maximum time between last activity of the inet and disconnection. The value is specified in millieconds. Use 0 to wait indefinitely. If you use long time, be sure to set AttemptsToConnect property to 3 or more so that if connection is lost for some reason, the transport has a chance to reconnect without returning the message it was delivering as failed.
    Large inactivity time is reasonable when the transport is used in the systems, that have persistent connections with other computers (computational grids or multi-tier applications), where the links are not likely to change frequently. Remember, though, that some TCP implementations forcefully break inactive TCP connections. If you come across such system, reduce inactivity time or send empty messages (so-called "keep-alive" messages) from time to time to keep TCP connection alive.

See also:     AttemptsToConnect

 
Contact Us | Subscribe | Terms of Use | Trademarks | Privacy Statement
Copyright (c) 1998-2005, EldoS Corporation