Can someone suggest some online demos and docs on Socket Programming in
Java?
Preferable with java examples to test.
Eventually I need to write a servlet that processes messages between
machines using sockets!

I do have a Linux/Apache/JServ machine working great for my JDBC servlets.

I attempted a sample code(listed below) to get the name and IP from my
server.
But, the error I'm getting is "500 Internal Server Error"
"The server encountered an internal error or misconfiguration and was unable
to complete your request."
My jserv.log file reveals "java.lang.IllegalAccessException: HostName"
I'm not quite sure how to run this code yet...but hope to get up to speed on
this topic of socket programming!

Thanks,
Stephen.





/*************************************************/
/* HostName - get's name of local machine        */
/*************************************************/

     import java.net.InetAddress;
     import java.net.UnknownHostException;

     class HostName {
        public static void main(String[] args) {
           InetAddress ia;

           try {
              ia = InetAddress.getLocalHost();
              System.out.println("Local host name is "
                                 + ia.getHostName());
              System.out.println("Local host IP address is "
                                 + ia.getHostAddress());
           }
           catch ( UnknownHostException e ) {
              System.out.println("Unknown Local Host");
           }
        }
     }

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to