horrible name for a server
|
|
I just whipped that code up not too long ago the comments explain each part of the code(D). I need suggestions on improving it for ReD(Runescape Emulator D(Programming language) constructive criticism is welcome.Code:/* @author: _tango Initializes ReD on the host ip 127.0.0.1 port 43594 & listens for incoming connections */ import tango.io.Console; import tango.core.Thread; import tango.net.SocketConduit; import tango.net.InternetAddress, tango.net.ServerSocket; void main() { Cout(" Starting up ReD").newline; void run() { /* * Initializes ReD on a internet address, and port. * */ final server = new ServerSocket(new InternetAddress("localhost", 43594)); Cout(" ----------------------------").newline; Cout(" Project: ReD ").newline; Cout(" Host: 127.0.0.1 ").newline; Cout(" Port: 43594 ").newline; Cout(" Initialized Successfully ").newline; Cout(" Ready for remote connections").newline; Cout(" ----------------------------").newline; while(1) { /* * Allows the server to accept incoming connections. * */ final client = server.accept(); /* * Sends an Outgoing message to the console * whenever a connection is sent. */ Cout(" Incoming Connection.....").newline; } } (new Thread(&run)).start; }
Its ok, not the best but at least you gave me a better idea than what I had prior you telling me about it on msn.

I read the title and wondered what an acceptor was.. Until I read the code.
Its titled acceptor because the main purpose of the code is the bind the framework to a port, and allow it to accept incoming connections as it says in the commenting's.

nice one chub
Thanks, super_ told me that using auto is making the compiler to work harder. So I read over a few things and made an adjustment which is causing the accepting speed to be a tad bit faster probably a small proportion. Does anyone else have an suggestion?Update: Updated the CODE tags with new code.
| « JGF - Java Game Framework. | Help (ERROR) » |
| Thread Information |
Users Browsing this ThreadThere are currently 1 users browsing this thread. (0 members and 1 guests) |