Discuss this help topic in MsgConnect Forum

Filter: C++  Pascal  C#  VB.NET  Java  Java ME  ActiveX  DLL 


InetTransport     See also    

Specifies how long the inactive connection is kept.


    void setInactivityTime(unsigned long Value);
    unsigned long getInactivityTime(void);

    property InactivityTime : cardinal;

    Property InactivityTime As Long

    HRESULT _stdcall InactivityTime([in] unsigned long Value );
    HRESULT _stdcall InactivityTime([out, retval] unsigned long * Value );

    public long InactivityTime;

    Public Property InactivityTime As Long

    public void setInactivityTime(long time);
    public long getInactivityTime();

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

    void __stdcall MCInetTransportSetInactivityTime(HMCInetTransport h, unsigned long value);
    unsigned long __stdcall MCInetTransportGetInactivityTime(HMCInetTransport h);


  • h - handle to the object that was returned by Create method


    To increase efficiency of message delivery InetTransport 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.

Discuss this help topic in MsgConnect Forum