setTimeout

Declaration

void setTimeout(S7RClientSSjToken token, int milliseconds).

Purpose

This method sets timeout value for all get methods. The value is in milliseconds. A value of zero (0) means "NO Timeout". This method can be called at any time once you have a "token", and is the timeout value until another "setTimeout" is issued.

Parameters

Parameter Description
token The S7RClientSSjToken returned by Connect method.
milliseconds Time value for any subsequent "Get" methods.

Return

The method does not return any value.

Example

S7RClientSSj conn = new S7RClientSSj();
S7RClientSSjToken token = conn.Connect(url, userid, password);
conn.setTimeout(token, 10*1000);  // set 10 second timeout on gets
byte[] dataIn = conn.receiveWait(token);
if (dataIn != null) {
  conn.setTimeout(token, 5*1000);  // set 5 second timeout on registration response
  conn.sendRegistration(token, ServiceType.Trigger, “myServiceName”);
}
conn.Disconnect(token);