Ada*_*ile 9 c# sockets mono networking
那里有没有Mono(C#)兼容的网络/套接字库吗?
最好是:
如果它是:它真的很棒:
编辑:
为了澄清更多,我的"高于TCP/IP的一级"评论意味着我想要的东西基本上是一个自包含的服务器/客户端.我不想处理编写线程代码,处理每个连接等等.例如,我希望代码看起来像这样:
Server s = new Server(8080);
s.NewConnection += new ConnectionEventHandler(NewConnection);
s.DataRecieved += new DataEventHandler(NewData);
s.Start();
void NewConnection(object sender, EventArgs e)
{
s.Send((Connection)sender, "Hello World!"); //(Connection)sender is the connection instance so the server knows which to send the response to
}
void NewData(object sender, EventArgs e)
{
s.Send((Connection)sender, e.Data); //Echo back
}
Run Code Online (Sandbox Code Playgroud)
不是最干净的代码,但我认为它提供了基本的想法.