|
||
|
GP Mailing List
ATXGPSIG List
|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: Hi
>From: "TG VAN DEN BON" <12081299@puknet.puk.ac.za> >Reply-To: gameprogrammer@gameprogrammer.com >To: <gameprogrammer@gameprogrammer.com> >Subject: Re: Hi >Date: Wed, 29 Mar 2000 12:47:28 +0200 > >Hi, > >I saw that you made a chat program in Java - i'mm learning Java now and >would like to know how you did that if you don't mind. > >Thanx >Tom > I would say the most "diffucult" thing about it ( excluding the security ) was designing the GUI for it. I used the standard AWT classes to accomplish that. And besides that you have to: * Create a server ( seprate proggie ) bound to an unused port that listens for client requests ( I also impelmented a thread that checked before hand the desired port was availble ). I accomplished this by SeverSocket sever.accept(args). Then if a client connects, create a IOstream to read data in. Once you get data, you have to echo it to the other clients via a mulitcast socket. I should point out that I had the server runnig from my computer. I accomplised the sending of message by delegating an event handler to the "send" button which sent the specified string(s) to the server, which was in turn was echoed onto everyone connected to the server. Just start looking over the networking classes ( Socket, ServerSocket, InetAddress etc ) and check out Suns tutorials and it should be a piece of cake. Josiah ______________________________________________________ Get Your Private, Free Email at http://www.hotmail.com ================================================================= The GameProgrammer.Com mailing list is for the open discussion of any topic related to the art, science, and business of programming games. This list is especially tolerant of beginners. We were all beginners once To SUBSCRIBE or UNSUBSCRIBE please visit: http://gameprogrammer.com/mailinglist.html
|
|