单声道兼容网络/套接字库 [英] Mono Compatible Networking/Socket Library
问题描述
是否有任何单声道(C#)兼容网络/套接字库在那里
Are there any Mono (C#) compatible networking / socket libraries out there?
最好的东西是:
- 多线程
- 事件驱动
- 有能力的多个连接
- 把手客户端和服务器件
- 在单声道和MS .NET运行时运行
- 很简单
- 免费(而在商业软件中使用)
- Multi Threaded
- Event Driven
- Capable of multiple connections
- Handles client and server pieces
- Runs on Mono and MS .NET runtimes
- Very simple
- Free (And usable in commercial software)
这也将是真正伟大的,如果它是:
It would also be really great if it was:
- .NET Compact Framework的(Windows Mobile的)兼容
- 的MonoTouch(iPhone)兼容
编辑:
要澄清更多的,我的意思我的TCP / IP之上一个级别的评论是,我想要的东西,基本上是一个自包含的服务器/客户端。我不希望有处理编写的线程代码,处理每个连接等。例如,我会为爱的代码看起来是这样的:
To clarify more, what I meant by my "one level above TCP/IP" comment was that I want something that is basically a self contained server / client. I don't want to have to deal with writing the threading code, handling each connection, etc. For example, I would love for the code to look like this:
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
}
不干净的代码,但我认为它给人的基本主意。
Not the cleanest code, but I think it gives the basic idea.
推荐答案
这样的事情现在存在,结账的 networkComms.net 。 。请问各位需要的东西,也与单100%兼容
Something like this now exists, checkout networkComms.net. Does all of the things you require and is also 100% compatible with mono.
的免责声明的:我的开发人员为这个商业库中的一个
Disclaimer: I am one of the developers for this commercial library.
这篇关于单声道兼容网络/套接字库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!