Jiggy 0.26 |
SocketSummary
close
Closes all connections and disables the listening socket so that it will not accept any more incoming connections. The Socket instance becomes useless at this point; if you want to listen again, you will need to create a new one. onConnect
This function is called whenever a new connection is accepted but before any data is read from it. parameters
returns
examplevar socket = new Socket( 81 ); onDisconnect
Called whenever a connection is closed, either because the remote host closed it, you closed it or there was an error that caused it to close. parameters
notesDon’t try to send data to the connection, it is too late when this event happens. ClientSocketSummary
|
Creates a new socket listening on the given port.
Socket( int port )
Closes the specified connection.
bool disconnect( int connection )
Closes all current connections but allows new ones.
void disconnectAll()
Sends data synchronously to the given connection.
bool send( int connection , string data )
Sends the same data to all current connections.
sendAll( string data )
Closes all connections and disables the listening socket so that it will not accept any more incoming connections.
close()
This function is called whenever a new connection is accepted but before any data is read from it.
callback bool onConnect( int connection , string address )
This function is called when data arrives on the socket.
callback onData( int connection , string data )
Called whenever a connection is closed, either because the remote host closed it, you closed it or there was an error that caused it to close.
callback onDisconnect( int connection )
Creates a new client socket.
ClientSocket( )
bool connect( string host , int port )
Closes the connection.
disconnect()
bool isConnected readonly
Sends a string synchronously.
bool send( string data )
Sends the contents of a data instance.
bool sendData( Data data )
close()
This function is called when data arrives on the socket.
callback onData( Data data )
Called whenever the connection is closed, either because the remote host closed it, you closed it or there was an error that caused it to close.
callback onDisconnect( )