https://api.dartlang.org/stable/1.24.3/dart-html/WebSocket-class.html
// To use a WebSocket in your web app, first create a WebSocket object,
// passing the WebSocket URL as an argument to the constructor.
var webSocket = new WebSocket('ws://127.0.0.1:1337/ws');
// To send data on the WebSocket, use the send method.
if (webSocket != null && webSocket.readyState == WebSocket.OPEN) {
webSocket.send(data);
} else {
print('WebSocket not connected, message $data not sent');
}
// To receive data on the WebSocket, register a listener for message events.
webSocket.onMessage.listen((MessageEvent e) {
receivedData(e.data);
});
--
You received this message because you are subscribed to the Google Groups "Flutter Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to flutter-dev...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Niyazis-MBP:~ niyazitoros$ telnet
telnet> telnet 192.168.1.22 1024
Trying 192.168.1.22...
Connected to 192.168.1.22.
Escape character is '^]'.
Q101:_:49785:_:*************
1:_:2:_:119351:_:NİYAZİ TOROS
I try to test and find where is the error coming from. And I found that data that I send to socket is not correct:
Q: 28.06.2018 08:53:57->GET / HTTP/1.1. (the correct send data will be: Q101::49785::ABCDE)
A: 28.06.2018 08:53:57 ->:1::1::FAIL1
So how can I emit GET / HTTP/1.1. not to send to socket?