ks_websocket

Last updated:

0 purchases

ks_websocket Image
ks_websocket Images
Add to Cart

Description:

ks websocket

This library was built to facilitate the use of WebSocket and Socket, both client and server. For that, the same interface was created and the necessary implementations were carried out using dart:io and dart:html.
In this way it is possible to program for web and android (for example), with the same code, without worrying about importing dart:html for io devices.
Example #
final server = await KsSocketServer.bind(ipHost, ipPort);

server.listerConnection((clientAction) => clientAction.copyWith(
listerMessage: (message, data) {
print('listerMessage: $data');
},
onClose: (message) {
print('onClose');
},
onConnection: (_) => print('New Connection'),
));


final client = await KsSocket.connect(ipHost, ipPort);

client.send('Hello'));
client.send({
'id': 1005,
'user': 'name',
}));
await Future.delayed(const Duration(seconds: 1));
await client.close();

copied to clipboard
Upcoming Versions: #

Implement the WebSocket server;
Create unit tests;
Develop a test application;

Additional information #
Feel Free to request any missing features or report issues here.

License:

For personal and professional use. You cannot resell or redistribute these repositories in their original state.

Files In This Product:

Customer Reviews

There are no reviews.