Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/flutter/9.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
带有node.js的Flatter Socket_io_客户端_Node.js_Flutter_Socket.io - Fatal编程技术网

带有node.js的Flatter Socket_io_客户端

带有node.js的Flatter Socket_io_客户端,node.js,flutter,socket.io,Node.js,Flutter,Socket.io,我的颤振器插座有问题。我对套接字使用“socket\u io\u client”模块。我可以用node.js连接正在运行的网站。但我不能接受任何数据。顺便说一句,我确定,我的网站发送数据 我的代码: import 'package:socket_io_client/socket_io_client.dart' as IO; IO.Socket socketIO = IO.io('http://xxxxxx.com', <String, dynamic>{ 'transports':

我的颤振器插座有问题。我对套接字使用“socket\u io\u client”模块。我可以用node.js连接正在运行的网站。但我不能接受任何数据。顺便说一句,我确定,我的网站发送数据

我的代码:

import 'package:socket_io_client/socket_io_client.dart' as IO;

IO.Socket socketIO = IO.io('http://xxxxxx.com', <String, dynamic>{
'transports': ['websocket'],
'autoConnect': false
});

Future<void> connect() async {
socketIO.connect();
socketIO.on('connect', (_) {
print('connect');
});
socketIO.on('bildirim', (data) {
sockettengelenler = data;
});
socketIO.on('disconnect', (_) => print("disconnect"));
}

Future<void> disconnect() async {
socketIO.disconnect();
socketIO.dispose();
}
import'包:socket\u io\u client/socket\u io\u client.dart'作为io;
IO.Socket socketIO=IO.IO('http://xxxxxx.com', {
“传输”:[“websocket”],
“自动连接”:false
});
Future connect()异步{
socketIO.connect();
socketIO.on('connect',(){
打印(“连接”);
});
socketIO.on('bildirim',(数据){
Sockettengeller=数据;
});
socketIO.on('disconnect'),()=>打印(“disconnect”);
}
Future disconnect()异步{
socketIO.disconnect();
socketIO.dispose();
}
谢谢