|
we have...
It is the java New I/O package... More commonly referred to as nio.Code:// Initialize the networking objects. selector = Selector.open(); address = new InetSocketAddress(host, port); System.out.println("Starting RuneSource on " + address + "..."); serverChannel = ServerSocketChannel.open(); // ... and configure them! serverChannel.configureBlocking(false); serverChannel.socket().bind(address); serverChannel.register(selector, SelectionKey.OP_ACCEPT);
@ Warped Reality, of course it uses IO... I/O stands for input/output afaik.
NIO is by far more efficient than IO. RuneSource is also faster than any Netty/MINA/XSocket/Grizzly frameworks I've ever seen.Code:import java.io.IOException; import java.net.InetSocketAddress; import java.nio.channels.SelectionKey; import java.nio.channels.Selector; import java.nio.channels.ServerSocketChannel; import java.nio.channels.SocketChannel; import java.util.HashMap; import java.util.Map; /** * The main core of RuneSource. * * @author blakeman8192 */ public class Server implements Runnable {
What you idiot, I asked a legitimate question.
I read through it quick, I thought he was talking about just using the standard IO. Either way I would have rather seen him use netty or grizzly, but oh well. The reason for that is because I like tweaking with the core of the server and those frameworks have a lot of extras to use. I'm aware that they're built around NIO
Really? Nice.
As I said on moparscape, good luck. I can't wait until you finish player updating.
*cough* Get that guide on player updating written *cough*
I have a question.
How fast is this method.
For me my method in rs2hd is this.Code:getSocketChannel().write(buffer);
and it takes anywhere from 20,000 - 2,000,000 nano seconds usually averages 240,000 ish.Code:p.getSession().write(mainPacket.toPacket());
i'm trying to find a networking which can send information much faster then 240,000 average because that's too much time per player.
i need it be 30,000-120,000 and no higher other then regular delays due to computer running too much stuff or problem with internet.
Iv'e been trying to create a Netty base but going through hell trying to get it do login keeps having issues reading/writing information i really suck at networking parts of the servers.
« Previous Thread | Next Thread » |
Thread Information |
Users Browsing this ThreadThere are currently 1 users browsing this thread. (0 members and 1 guests) |