1. A method of maintaining a connection between a mobile terminal and a network element in a network, the method, comprising: monitoring the connection to determine if disconnection of the connection occurs as a result of altering of a time interval between keep-alive messages exchanged between the mobile terminal and the network element; determining a value for the time interval based on an associated cost to send the keep-alive messages; wherein, the cost to send the keep-alive messages includes a battery consumption involved in re-establishing the connection.