socket.io有问题 当我尝试连接到localhost:8080时,无法在console.log中看到服务器正在运行,但是正确绑定到服务器的套接字却从未显示“新连接”。
能帮我吗?
import express from "express";
import socket from "socket.io";
const app = new express();
const server = app.listen(`${process.env.PORT_API}`, () => {
console.log(`Server is running on port ${process.env.PORT_API}`);
});
const io = new socket(server);
io.on('connection', (socket) => {
console.log("new connection");
})
答案 0 :(得分:0)
// Public property what passed from Form1
public List<object> listFromForm1 { get; set; }
public Form2()
{
InitializeComponent();
}
private void Form2_Load(object sender, EventArgs e)
{
// Now you can handle any details of list
}
参考:Link here