TCPObject
Engine/source/app/net/tcpObject.h
Public Types
enum
State { Disconnected DNSResolved Connected Listening }
Private Types
enum
_Anonymous_ { TableSize = 256 TableMask = 0xFF }
Protected Types
Parent
Public Functions
addToTable(NetSocket newTag)
DECLARE_CALLBACK(bool , onPacket , (const char *data) )
DECLARE_CALLBACK(void , onConnected , () )
DECLARE_CALLBACK(void , onConnectFailed , () )
DECLARE_CALLBACK(void , onConnectionRequest , (const char *address, const char *ID) )
DECLARE_CALLBACK(void , onDisconnect , () )
DECLARE_CALLBACK(void , onDNSFailed , () )
DECLARE_CALLBACK(void , onDNSResolved , () )
DECLARE_CALLBACK(void , onEndReceive , () )
DECLARE_CALLBACK(void , onLine , (const char *line) )
bool
bool
bool
onAdd()
Called when the object is added to the sim.
onConnectionRequest(const NetAddress * addr, U32 connectId)
bool
processArguments(S32 argc, ConsoleValueRef * argv)
Process constructor options. (ie, new SimObject(1,2,3))
bool
processLine(UTF8 * line)
Detailed Description
Public Types
State
Enumerator
- Disconnected
- DNSResolved
- Connected
- Listening
Private Types
@44
Enumerator
- TableSize = 256
- TableMask = 0xFF
Protected Types
typedef SimObject Parent
Private Attributes
TCPObject * mNext
State mState
NetSocket mTag
Private Static Attributes
TCPObject * table [TableSize]
Protected Attributes
U8 * mBuffer
U32 mBufferSize
U16 mPort
Public Functions
TCPObject()
~TCPObject()
addToTable(NetSocket newTag)
connect(const char * address)
DECLARE_CALLBACK(bool , onPacket , (const char *data) )
DECLARE_CALLBACK(void , onConnected , () )
DECLARE_CALLBACK(void , onConnectFailed , () )
DECLARE_CALLBACK(void , onConnectionRequest , (const char *address, const char *ID) )
DECLARE_CALLBACK(void , onDisconnect , () )
DECLARE_CALLBACK(void , onDNSFailed , () )
DECLARE_CALLBACK(void , onDNSResolved , () )
DECLARE_CALLBACK(void , onEndReceive , () )
DECLARE_CALLBACK(void , onLine , (const char *line) )
DECLARE_CONOBJECT(TCPObject )
disconnect()
emptyBuffer()
finishLastLine()
getState()
isBufferEmpty()
listen(U16 port)
onAdd()
Reimplemented from: SimObject
onConnected()
Reimplemented by: HTTPObject
onConnectFailed()
Reimplemented by: HTTPObject
onConnectionRequest(const NetAddress * addr, U32 connectId)
onDisconnect()
Reimplemented by: HTTPObject
onDNSFailed()
onDNSResolved()
onReceive(U8 * buffer, U32 bufferLen)
Reimplemented by: HTTPObject
parseLine(U8 * buffer, U32 * start, U32 bufferLen)
processArguments(S32 argc, ConsoleValueRef * argv)
Reimplemented from: SimObject
processLine(UTF8 * line)
Reimplemented by: HTTPObject
removeFromTable()
send(const U8 * buffer, U32 bufferLen)
sendFile(const char * fileName)
Send an entire file over tcp.
fileName Full path to file you want to send
return:true if file was sent, false if not (file doesn't exist)
setPort(U16 port)