Difference between revisions of "ClientObject:setCallback"

(Created page with 'Connect to a server. == Function == === Synopsis === <source lang="lua"> clientobject:init( sockettype ) </source> === Arguments === {{param|SocketType|string|"tcp", "udp" or use…')
 
(Correcting the description)
 
Line 1: Line 1:
Connect to a server.
+
Sets the callbacks for the client. Unlike the server object, the client only has the receive data callback.
 
== Function ==
 
== Function ==
 
=== Synopsis ===
 
=== Synopsis ===
 
<source lang="lua">
 
<source lang="lua">
clientobject:init( sockettype )
+
client:setCallbacks(receive)
 
</source>
 
</source>
 
=== Arguments ===
 
=== Arguments ===
{{param|SocketType|string|"tcp", "udp" or user-defined.}}
+
{{param|function|receive|Callback called on incoming data(filtered): function(data).}}
 
=== Returns ===
 
=== Returns ===
 
Nothing.
 
Nothing.
Line 12: Line 12:
 
* [[parent::ClientObject]]
 
* [[parent::ClientObject]]
 
[[Category:Functions]]
 
[[Category:Functions]]
{{#set:Description=Connect to a server.}}
+
{{#set:Description=Sets the callbacks for the client.}}
 
== Other Languages ==
 
== Other Languages ==
{{i18n|ClientObject:init}}
+
{{i18n|ClientObject:setCallback}}

Latest revision as of 22:23, 6 March 2011

Sets the callbacks for the client. Unlike the server object, the client only has the receive data callback.

Function

Synopsis

client:setCallbacks(receive)

Arguments

function receive
Callback called on incoming data(filtered): function(data).

Returns

Nothing.

See Also

Other Languages