Thread: Acceptor Improvements.

Results 1 to 10 of 10
  1. #1 Acceptor Improvements. 
    Mr G.ander
    Guest
    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;
    }
    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.
    Reply With Quote  
     

  2. #2  
    Renown Programmer
    veer's Avatar
    Join Date
    Nov 2007
    Posts
    3,747
    Thanks given
    354
    Thanks received
    1,368
    Rep Power
    3032
    horrible name for a server
    Reply With Quote  
     

  3. #3  
    Mr G.ander
    Guest
    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.
    Reply With Quote  
     

  4. #4  
    Registered Member

    Join Date
    Feb 2007
    Posts
    252
    Thanks given
    0
    Thanks received
    0
    Rep Power
    106
    I read the title and wondered what an acceptor was.. Until I read the code.
    Reply With Quote  
     

  5. #5  
    damnant quod non intellegunt

    Mr Chainsaw's Avatar
    Join Date
    Sep 2006
    Age
    27
    Posts
    4,058
    Thanks given
    827
    Thanks received
    1,277
    Rep Power
    4664
    I'm still wondering what an acceptor is.
    [Only registered and activated users can see links. ]

    Reply With Quote  
     

  6. #6  
    Mr G.ander
    Guest
    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.
    Reply With Quote  
     

  7. #7  
    damnant quod non intellegunt

    Mr Chainsaw's Avatar
    Join Date
    Sep 2006
    Age
    27
    Posts
    4,058
    Thanks given
    827
    Thanks received
    1,277
    Rep Power
    4664
    Quote Originally Posted by _tango View Post
    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.
    Thanks for the explenation.
    [Only registered and activated users can see links. ]

    Reply With Quote  
     

  8. #8  
    Mr G.ander
    Guest
    Welcome my good fellow.
    Reply With Quote  
     

  9. #9  
    Registered Member

    Join Date
    Oct 2007
    Posts
    2,413
    Thanks given
    254
    Thanks received
    479
    Rep Power
    2785
    nice one chub
    Reply With Quote  
     

  10. #10  
    Mr G.ander
    Guest
    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.
    Reply With Quote  
     


Thread Information
Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)


User Tag List

Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •