Mina

I am having some problems using this (http://directory.apache.org/subprojects/mina/index.html), and was wondering if anyone has the code for a simple client/server that can send and receive text.

Thanks.

EDIT: In the examples they show that you can take an IoSession and just write any object to it. When I try to do this, there is only one method. I have looked at all versions (0.8.0, 0.8.1 and 0.8.2) and it requires 2 arguments.
Also a lot of the methods and classes they use in the examples do not exist. I have tried all versions but it seems that they do not update things well or something. For example, they use a ConnectFuture that does not exist in the most recent version! It makes me wonder how they managed to write the example.

From what I’ve read of MINA it’s incredibly slow. I’ll try to post a link to some benchmarks if I can find them again…

Well I was going to use it because it scales well but if you can prove that it is slow…then I’ll try to figure something else out.

I think I will go with NIO.

Thank you

I’m oft accused of pushing my own APIs, but have you considered using JGN?

http://javagamenetworking.dev.java.net

I don’t think just me counts as “oft” - but I’d really like to see those performance benchmarks if you can find them.

Kev

I am using MINA and am pretty happy with it ;D My game does not require real-time performance, so I cannot tell you if MINA is fast enough? “Seems” pretty fast. And yes, I would be interested to see these benchmarks as well! What the examples concerns, do not use the ones on the web. Download the MINA version you like. I currently use 0.9.4 but the 0.8.4 is the stable version. The examples come with the download - the ones on the web might be 0.9.5 or 0.8.4?

If you use MINA depends on your requirements. I don’t know sunsett’s API, so I cannot quite compare it - looks interesting? However, I would advice you NOT to use NIO directly, it’s just a pain, especially if you are dealing with very different type of packages you like to send over the network. NIO also forces you to deal with some really low-level networking details, especially ByteBuffer can drive you crazy …

Alright, here’s my take on MINA:
-pretty well maintained: new release/bugfix every 1-2 months (if you download it - don’t look at the examples on the web)
-easy to use, because it deals with all the low-level API calls
-easy to add encryption if you like
-use Input/OutputStreams to send/receive data -OR- use an enhanced=simplified ByteBuffer
-might be ok for real-time?

I wrote a little wrapper for MINA to write/read from Input/OutputStreams. I have a JUnit test case. I also implemented RSA and Triple-DES encryption which can be turned on if you desire. Let me know if you are interested in those files, writing a String should be pretty easy. Also, I am emulating the HTTP-protocol, which would allow you to send messages from/to a firewall. But as I said, if you are interested in real-time performance, you would have to test it first, if it satisfies your needs?

Sorry about spouting off, now that I went back to look I think it was JGroups I was thinking of and here’s the benchmark I was looking at:

http://www.jgroups.org/javagroupsnew/perf/Report.html

So to clarify, I have no beef with Mina. :slight_smile:

However, I haven’t found any benchmarks for Mina. :-p

But you still have beef with anyone not using JGN right? :stuck_out_tongue:

No, if they aren’t smart enough to realize how much better than everything else it is what can I do? ;D

I hold no grudge. :wink: