This project is read-only.


What does Mina mean?

Mina is:
  • An acronym for 'Multipurpose Infrastructure for Network Applications';
  • A girl's name;
  • 'South' in Japanese;
  • 'Mine' (as in mineshaft) in Spanish and Portuguese;
  • Look at Wikipedia for more meanings.

What transport does Mina.NET support?

Mina.NET currently supports TCP and UDP based on .NET asynchronous socket (APM for .NET 2.0 and SocketAsyncEventArgs for .NET 4), and serial port communication.

What is required to build/run Mina.NET?

.NET framework 2.0 or above is required to build Mina.NET. Mina.NET core module depends on one library:

How can I get help?

The primary source to get help is the User Guide. You can also fire issues or discussions

How / What can I contribute?

You can contribute anything related with Mina; examples, useful codecs for existing protocols, tutorials, feature improvements, bug fixes, benchmarks, and whatever. Go to the Source page, Fork and make Pull Requests.

Can Mina.NET...?

Can I use Mina.NET to create client (or server) applications?

Yes. You can create both client and server applications with Mina.NET. Please take a look at IoConnector and IoAcceptor.

Can Mina.NET handle text protocols such as HTTP?

Yes. Please take a look at the Reverser example.

Can Mina.NET handle complex binary protocols?

Yes. Please take a look at the SumUp example.

Can I implement protocols that keeps connection alive with Mina.NET?

Yes. Mina.NET doesn't close any connections unless you call IoSession.Close() or connection is closed by the remote peer.

Does Mina.NET support SSL/TLS out-of-the-box?

Yes. Mina.NET supports SSL/TLS out-of-the-box. Please refer to SSLFilter.

Do I need to make my IoHandler thread-safe?

It depends on your implementation. If you access the resource which is shared across multiple sessions, you have to make it thread-safe. If the resource is not shared at all and accessed by only one session (e.g. storing context information as a session attribute), then you don't need to make it thread-safe. It is because all events generated by Mina.NET are transmitted to your handler in order (when using the Executor Filter), and the newer event is not processed if the event handler method for the older event for the same session hasn't returned yet.

What transport types can Mina.NET support except TCP/IP and UDP/IP?

Virtually all kind of transport types. Mina.NET API is designed to be transport-independent. You can implement any transport type support only if you can conform to Mina.NET API.

How do I...?

How can I store session-specific information?

Sessions are capable of custom attributes that you can add or remove at any time. These custom attributes are not shared between sessions; it is designed to store session specific information.

How can I separate an event handler into multiple handlers when I implement complex business logic?

Please refer to DemuxingIoHandler.

How do I close my sessions and dispose my Connector?

You can do it in two steps: first close your sessions, then dispose the connector. Of course, if you dispose your Connector first, then all the sessions will be closed.

When should I implement my protocol handler using filters?

IoFilter is usually considered reusable. Please implement commonly used business logic such as authorization and logging as a filter. In case you implement just complex multi-layer protocols like Kerberos, you could consider using Mina.Handler.Chain namespace.

How can I detect when the remote peer doesn't send a response message for my request message?

You can't use SessionIdle event simply here. Schedule a timeout task to be executed on timeout situation for each request message, and cancel it when you receive the corresponding response message.

How can I let Mina.NET log messages using my favorite logging framework (i.e. Log4net)?

Please refer to 'Configuring Logging' section in the Common.Logging Manual.


No data is writtin out to the session even if the buffer is not empty.

Please make sure if you called IoBuffer.Flip() to flip the buffer before writing the buffer out.

Why does SocketConnector send several messages as one message?

For example, I tried using SocketConnector to send "abc" and "def", but it sent "abcdef". Is it a Mina bug?

No, this is due to your OS trying to send packets more efficiently (see Nagle algorithm). You can enable/disable Nagle's algorithm by setting ISocketSessionConfig.NoDelay property, e.g.:

((ISocketSessionConfig)connector.SessionConfig).NoDelay = true;

However, even if you do this you cannot expect one session.Write(bytes) in Mina.NET to correspond to one TCP packet on your network. You should probably implement your own Mina.NET IProtocolDecoder to handle the assembly of incoming bytes into message objects. The TextLineCodec is a good start if the protocol you're implementing is based on text lines. For a more advanced example have a look at the SumUp example.

Last edited Apr 7, 2014 at 4:25 PM by longshine, version 4