TorqueScript Reference
Public Member Functions | List of all members
TCPObject Class Reference

#include <tcpObject_ScriptBinding.h>

Inherits SimObject.

Inherited by HTTPObject.

Public Member Functions

void connect (addr)
 
void disconnect ()
 
void listen (port)
 
void openAndConnect (string addr)
 
void send (...)
 
String URLEncodeString (string data)
 
- Public Member Functions inherited from SimObject
void assignFieldsFrom (SimObject)
 
Integer clone ([copyDynamicFields=false]?)
 
void delete ()
 
Integer getId ()
 
void setName (newName)
 
String getName ()
 
String getClassNamespace ()
 
String getSuperClassNamespace ()
 
void setClassNamespace (nameSpace)
 
void setSuperClassNamespace ()
 
Boolean isMethod (string methodName)
 
String call (methodName, [args] *)
 
void dumpClassHierarchy ()
 
void dump ()
 
Boolean isMemberOfClass (string classname)
 
String getClassName ()
 
String getFieldValue (fieldName)
 
Boolean setFieldValue (fieldName, value)
 
Boolean setEditFieldValue (fieldName, value)
 
Integer getDynamicFieldCount ()
 
String getDynamicField (index)
 
Integer getFieldCount ()
 
String getField (int index)
 
void setProgenitorFile (file)
 
String getProgenitorFile ()
 
Integer getType ()
 
String getFieldType (fieldName)
 
void setInternalName (string InternalName)
 
String getInternalName ()
 
Boolean isChildOfGroup (groupID)
 
Integer getGroup ()
 
Boolean startTimer (callbackFunction, float timePeriod, [repeat]?)
 
void stopTimer ()
 
Boolean isTimerActive ()
 
Integer schedule (time, command, [arg] *)
 
void startListening (SimObject)
 
void stopListening (SimObject)
 
void addListener (SimObject)
 
void removeListener (SimObject)
 
void removeAllListeners ()
 
void postEvent (String eventName, String data)
 
Boolean save (fileName, [selectedOnly]?)
 
void addFieldFilter (fieldName)
 
void removeFieldFilter (fieldName)
 

Member Function Documentation

◆ connect()

void connect ( addr  )

Use the connect method to request a connection to a remote agent at the address addr.

Parameters
addrA string containing an address of the form: ?A.B.C.D:Port?, where A .. B are standard IP numbers between 0 and 255 and Port can be between 1000 and 65536.
Returns
No return value.
See also
disconnect

◆ disconnect()

void disconnect ( )

Use the disconnect method to close a previously opened connection without destroying the requesting TCPOpbject. This will close any open connection, but not destroy this object. Thus, the object can be used to open a new connection.

Returns
No return value.
See also
connect

◆ listen()

void listen ( port  )

Use the listen method to allow this TCPObject to accept connections on the specified port.

Parameters
portA value between 1000 and 65536.
Returns
No return value

◆ openAndConnect()

void openAndConnect ( string  addr)

Connect to the given address, making sure that the connection is open first.

◆ send()

void send (   ...)

Use the send method to send any number of parameters, as strings, one at a time to the agent at the other end of the connection.

Parameters
...Any number of arguments, as strings. Each string is sent separately. i.e. The arguments are not concatenated.
Returns
No return value

◆ URLEncodeString()

String URLEncodeString ( string  data)

Performs URLEncoding on a single string.