client_server_sockets 2.0.0
client_server_sockets: ^2.0.0 copied to clipboard
A simple WebSocket-based client-server package that works on every platform, including web.
2.0.0 #
Breaking changes
- Rebuilt on WebSocket (
package:web_socket_channel) instead of rawdart:ioSocket/ServerSocket.SocketClientnow runs on every platform, including web — raw TCP sockets can never work in a browser. SocketServerremains native-only (a browser page cannot accept incoming connections), but the package now compiles cleanly when imported from a web app.- Replaced the global singletons
Client.instance/Server.instancewith instantiable classesSocketClient()/SocketServer(), so an app can run more than one of each. - Clients are now identified by a server-assigned
int clientIdinstead of a rawSocket/remote port.Payload.portis nowPayload.clientId. - Replaced
dart:io'sSocketExceptionwith a newSocketStateExceptionfor invalid-state errors (not available on web, and not really the right fit for app-level state errors).
1.1.2 #
- Fixed accessing properties of a closed socket
1.1.1 #
Breaking changes
- Replaced callback functions with stream events
- Methods throw a
SocketExceptionwhen used in an invalid state - Exposed a
clientsgetter inServerclass to access the connected clients - Replaced the default server port with a random port chosen by the system
- Removed
remotePortinClientclass as it's already known when connecting to the server
1.0.1 #
- Exported
payloadfile to the package
0.0.2 #
- Changed example file to
main.dartso the Example tab shows up - Removed
Getting Startedsection from README
0.0.1 #
- Initial version.