The resource loading... loading...

exchange.SetTimeout

The exchange.SetTimeout() function is used to set the timeout of the rest request for the {@var/EXCHANGE exchange} exchange object.

exchange.SetTimeout(timeout)

The timeout parameter is used to specify the number of milliseconds for the timeout setting. timeout true number

function main() {
    exchange.SetTimeout(3000)
    Log(exchange.GetTicker())
}
def main():
    exchange.SetTimeout(3000)
    Log(exchange.GetTicker())
void main() {
    exchange.SetTimeout(3000);
    Log(exchange.GetTicker());
}

The parameter timeout is a millisecond value, 1000 milliseconds equals 1 second. Restricted to the rest protocol only, used to set the timeout on rest requests, it takes effect by setting once only. For example, exchange.SetTimeout(3000), sets the rest request timeout for the exchange exchange object to 3 seconds. Calling functions with network requests such as exchange.GetTicker() that do not receive an answer for more than 3 seconds will time out, and function calls that do time out will return null values. SetTimeout() is not a global function, it is a method of the {@var/EXCHANGE exchange} exchange object.

{@var/EXCHANGE exchange}

exchange.SetProxy Threads