.NET implementation of [Apache MINA] (http://mina.apache.org/). I like the ideas in it, simple yet functional, but I failed to find one in .NET, finally I created one.
Mina.NET is a network application framework which helps users develop high performance and high scalability network applications easily. It provides an abstract event-driven asynchronous API over various transports such as TCP/IP via async socket.
Mina.NET is often called:
Mina.NET is a simple yet full-featured network application framework which provides:
IoAcceptor acceptor = new AsyncSocketAcceptor();
acceptor.FilterChain.AddLast("logger", new LoggingFilter());
acceptor.FilterChain.AddLast("codec", new ProtocolCodecFilter(new TextLineCodecFactory(Encoding.UTF8)));
acceptor.ExceptionCaught += (o, e) => Console.WriteLine(e.Exception);
acceptor.SessionIdle += (o, e) => Console.WriteLine("IDLE " + e.Session.GetIdleCount(e.IdleStatus));
acceptor.MessageReceived += (o, e) =>
{
String str = e.Message.ToString();
// "Quit" ? let's get out ...
if (str.Trim().Equals("quit", StringComparison.OrdinalIgnoreCase))
{
e.Session.Close(true);
return;
}
// Send the current date back to the client
e.Session.Write(DateTime.Now.ToString());
Console.WriteLine("Message written...");
};
acceptor.Bind(new IPEndPoint(IPAddress.Any, 8080));
See https://mina.codeplex.com/documentation for more.
Licensed under the Apache License, Version 2.0. You may obtain a copy of the License at [LICENSE] (LICENSE) or http://www.apache.org/licenses/LICENSE-2.0.
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。
Activity
Community
Health
Trend
Influence
:Code submit frequency
:React/respond to issue & PR etc.
:Well-balanced team members and collaboration
:Recent popularity of project
:Star counts, download counts etc.