Hello everybody,
Last year, I needed a component in AI2 that did the work of a client socket. As there wasn't any, I used Web component instead, but it didn't do everything I need. A few days ago, I saw that there were the possibility to use extensions, but didn't find a client socket one. I decided to make one so.
Here it is : ClientSocket extension V0.4.4.2 (Trailling 00 bug repair release) !
Properties :
- serverAddress (R/W)
- serverPort (R/W)
- hexaStringMode (R/W)
- connectionState (RO)
- debugMessages (RW)
Methods :
- Connect
- Disconnect
- SendData
Events :
- DataReceived
- RemoteConnectionClosed
Known bugs :
- I think that only messages less than 1024 bytes work
- If connection to server is lost (not server shutdown, but wifi connection problem by example), no events will indicate it (but crashes are now fixed :-) thx Axeley)
- on some android devices, disconnection of the serveur is not crashing anymore the app.
If you want to send non ascii data, modify hexaStringMode to true and send data as "303132" to send characters "012". Received data will be also hexa characters.
If you can, you can use it, test it and report me suggestions and bugs.
Cheers,
Jean-Rodolphe Letertre