[英]Connect to socket.io from C# layer (BLL)
I'm tyring to connect to socket client in my Business Login layer (C#) and send message to socket server (node.js)我正在尝试连接到我的业务登录层(C#)中的套接字客户端并将消息发送到套接字服务器(node.js)
but it's goes wrong.但它出错了。
It's connect multiple times and don't create the emit function它多次连接并且不创建发射功能
Please, can someone help me?拜托,有人可以帮我吗? Thank you
谢谢
public void SocketSet(bool b, int action_type)
{
if (currentState != b)
{
if (b && !connected)
{
var obj = new JObject();
obj["room"] = "Bb";
obj["content"] = "test";
obj["from"] = "test";
obj["dir"] = "left";
obj["avatar"] = "";
connected = true;
manualResetEvent = new System.Threading.ManualResetEvent(false);
var options = CreateOptions();
socket = IO.Socket("http://localhost:3000", options);
socket.Emit("new-message", obj);
socket.Open();
}
}
I guess not define socket?我猜不是定义套接字?
What is socket?什么是插座?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.