Language: English Programming Language: Java Published by: technochump [not registered] Last Update: 5/15/2006 Views: 10279
This is a simple server allowing multiple users to connect and communicate simultaneously. It is written as a component so that it can be extended into a thread where your code can be inserted. It may not be the best server but it should be goodfor testing. Have any questions just send me an email <technochump@netscape.net> Here is how you extend it.import java.io.*;/*** The Server Component I called esKernel ***/public class nTalk extends esKernel {public static void main(String argv[]) {/*** This was a chat client I called it nTalk ****/new nTalk(argv);}nTalk(String argv[]) { /*** Required to kick off the Server ***/ startServer(argv);}/*** Once the server is started it will call this function ***/public void serverStarted() { }/*** Once a user(lPID) logs in this function is kicked off ****/public void clientLogin(int lPID) { /*** Send information to the user where lpid = user **/ clientSend("Welcome User", lPID); /*** Function to disconnect user where lpid = user **/ disconnectClient(lPID);}/*** Once a user(lPID) logs off this function is kicked off ***/public void clientLogout(int lPID) { }/*** when the user sends information to the server this function kicks off ***/public void clientRecieve(String lineIn, int lPID) { }}
Name *
Email (won't be displayed) *
Website
Comment *
Security Code *