This chapter presented the Intercom project, a fun application that uses its own connection over the Internet, as well as Java methods, to communicate.

All you have to do is to start up Intercom 1 on one machine. Intercom 1 functions as the server, and after you start it, it'll wait for a connection from Intercom 2 over the port the Intercom project uses (in this case, 8765, but you can change it simply by editing the code).

After Intercom 1 is running, start Intercom 2. Enter the IP address of Intercom 1 into the text field in Intercom 2 (if you're using broadband, you should have a fixed IP address; take a look in the Control Panel in Windows, for example, and open the Broadband icon, or ask your broadband ISP how to determine your IP address). Then you just click the Connect button, and Intercom 2 connects to Intercom 1.

When the two intercoms are connected, you can simply type in the lower text area control in either one and click the Send buttonyour text will appear in the upper text area in the other intercom. It's as simple as thatyour own personal connection over the Internet. You don't have to host any code on web serversall you've got to do is to connect and play using the Intercom project.

    Java After Hours(c) 10 Projects You'll Never Do at Work
    Java After Hours: 10 Projects Youll Never Do at Work
    ISBN: 0672327473
    EAN: 2147483647
    Year: 2006
    Pages: 128 © 2008-2017.
    If you may any questions please contact us: