client_server_sockets 1.1.2 copy "client_server_sockets: ^1.1.2" to clipboard
client_server_sockets: ^1.1.2 copied to clipboard

A simple client-server sockets wrapper package around the Socket and the ServerSocket classes.

A simple client-server sockets wrapper package around the Socket and the ServerSocket classes.

Usage #

Start the server using:

Server.instance.start();

Connect the client to the server using its address and port:

Client.instance.connect(serverIp, serverPort);

To send a message to the server, use the send() function like this:

Client.instance.send("Hello World!");

To broadcast a message to all clients, use the broadcast() function like this:

Server.instance.broadcast("Broadcasted message");

To send a message from a client to another, you can use the Payload class to help you with that along with the sendTo() function in the server. Check the example for more info.

3
likes
150
points
131
downloads

Publisher

unverified uploader

Weekly Downloads

A simple client-server sockets wrapper package around the Socket and the ServerSocket classes.

Repository (GitHub)
View/report issues

Documentation

API reference

License

BSD-3-Clause (license)

More

Packages that depend on client_server_sockets