There are 2 timeouts you can set for the component controlling s2s communication.
'max-packet-waiting-time' - this sets the maximum time for the packets waiting for sending to some remote server. Sometimes, due to networking problems or DNS problems it might be impossible to send message to remote server right away. Establishing a new connection may take time or there might be communication problems between servers or perhaps the remote server is restarted. The Tigase will try a few times to connect to the remote server before giving up. This parameter specifies how long the packet is waiting for sending before it is returned to the sender with an error. The timeout is specified in seconds:
'max-inactivity-time' - this parameters specifies the maximum s2s connection inactivity time before it is closed. If the connection is not in use for a long time, perhaps it doesn’t make sense to keep it open and it resources up. The Tigase closes s2s connection after specified period of time and reconnects when it is necessary. The timeout is specified in seconds: