en:code:data:tcp
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| code:data:tcp [2011/01/27 20:32] – jmgr | en:code:data:tcp [2021/02/13 11:23] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 18: | Line 18: | ||
| * onReadyRead - ([[# | * onReadyRead - ([[# | ||
| * onBytesWritten - ([[# | * onBytesWritten - ([[# | ||
| + | * onError - ([[# | ||
| === Example === | === Example === | ||
| Line 24: | Line 25: | ||
| </ | </ | ||
| <code javascript> | <code javascript> | ||
| - | var myObject = new Sql({ | + | var myObject = new Tcp({ |
| onConnected: | onConnected: | ||
| { | { | ||
| - | Console.print(" | + | Console.print(" |
| }, | }, | ||
| onDisconnected: | onDisconnected: | ||
| { | { | ||
| - | Console.print(" | + | Console.print(" |
| } | } | ||
| }); | }); | ||
| Line 59: | Line 60: | ||
| === Notes === | === Notes === | ||
| This method is asynchronous, | This method is asynchronous, | ||
| - | To known when a connection is made use the [[# | + | To know when a connection is made use the [[# |
| ==== write ==== | ==== write ==== | ||
| Line 77: | Line 78: | ||
| === Notes === | === Notes === | ||
| This method is asynchronous, | This method is asynchronous, | ||
| - | To known when the data has been sent use the [[# | + | To know when the data has been sent use the [[# |
| ==== writeText ==== | ==== writeText ==== | ||
| Line 95: | Line 96: | ||
| === Notes === | === Notes === | ||
| This method is asynchronous, | This method is asynchronous, | ||
| - | To known when the text has been sent use the [[# | + | To know when the text has been sent use the [[# |
| ==== disconnect ==== | ==== disconnect ==== | ||
| Line 113: | Line 114: | ||
| === Notes === | === Notes === | ||
| This method is asynchronous, | This method is asynchronous, | ||
| - | To known when the connection is closed use the [[# | + | To know when the connection is closed use the [[# |
| ==== read ==== | ==== read ==== | ||
| Line 127: | Line 128: | ||
| === Notes === | === Notes === | ||
| - | To known when data is available use the [[# | + | To know when data is available use the [[# |
| ==== readText ==== | ==== readText ==== | ||
| Line 141: | Line 142: | ||
| === Arguments === | === Arguments === | ||
| - | - encoding - ([[code: | + | - encoding - ([[en:code: |
| === Returns === | === Returns === | ||
| Line 147: | Line 148: | ||
| === Notes === | === Notes === | ||
| - | To known when text is available use the [[# | + | To know when text is available use the [[# |
| ==== waitForConnected ==== | ==== waitForConnected ==== | ||
| Line 293: | Line 294: | ||
| <code javascript> | <code javascript> | ||
| myObject.onBytesWritten = function(bytes) | myObject.onBytesWritten = function(bytes) | ||
| + | { | ||
| + | //Event action | ||
| + | }; | ||
| + | </ | ||
| + | |||
| + | ==== onError ==== | ||
| + | Called when an error has occurred. | ||
| + | |||
| + | === Syntax === | ||
| + | <code javascript> | ||
| + | myObject.onError = function(errorMessage) {}; | ||
| + | </ | ||
| + | |||
| + | === Arguments === | ||
| + | - errorMessage - (string) text describing the error | ||
| + | |||
| + | === Example === | ||
| + | <code javascript> | ||
| + | myObject.errorMessage = function(errorMessage) | ||
| { | { | ||
| //Event action | //Event action | ||
| Line 301: | Line 321: | ||
| ==== OpenMode ==== | ==== OpenMode ==== | ||
| - | File open mode. | + | Open mode. |
| === Values === | === Values === | ||
| Line 313: | Line 333: | ||
| Example: | Example: | ||
| <code javascript> | <code javascript> | ||
| - | myObject.connect(" | + | myObject.connect(" |
| </ | </ | ||
en/code/data/tcp.1296160370.txt.gz · Last modified: (external edit)
