Yong,
The bug is nothing but if try to use the same port again it  gives
exception.
i think you follow this..
> ----------
> From:         Yong Hu[SMTP:[EMAIL PROTECTED]]
> Reply To:     A mailing list for discussion about Sun Microsystem's Java
> Servlet API Technology.
> Sent:         Tuesday, October 12, 1999 6:52 AM
> To:   [EMAIL PROTECTED]
> Subject:      Re: About BindException little change
>
> vijaya,
>   Thanks for your help.I has tried your code and it works well.But
> there is a bug in the code.The code "ServerSocket rSocket = new
> ServerSocket(SERVLET_PORT)" will throw a excepiton:address in use unless I
> close the serversocket first.
>
>   I has another quetion about RMI.I create tow RMI servers which are
> bound in port 1099.Each of them runs well singly,but when they run at
> the same time(in the same machine),the last one will throw a exception:
>   Unexpected exception: neseted exception is:
> java.lang.ClassNotFoundException:RmiServer1_Stub.
> Rmiserver1.class is one RMI server I has defined.
>
> thanks in advance.
> HuYong
>
> >From: Vijaya Mahalakshmi <[EMAIL PROTECTED]>
> >Reply-To: "A mailing list for discussion about Sun Microsystem's Java
> >        Servlet API Technology." <[EMAIL PROTECTED]>
> >To: [EMAIL PROTECTED]
> >Subject: Re: About BindException little change
> >Date: Mon, 11 Oct 1999 00:01:11 -0400
> >
> >Yong,
> >         I tried your program with little change which I am sending that,
> >the port which is in already  in use will  print 0,(that's what I think)
> ,
> >try this it will print your port number
> >import java.net.*;
> >import java.io.*;
> >
> >public class UsersServlet
> >{
> >
> >    static int SERVLET_PORT=10000;
> >    public static void main(String args[])
> >    {
> >      try
> >      {
> >          ServerSocket serverSocket = new ServerSocket(SERVLET_PORT);
> >          System.out.println(serverSocket.getLocalPort());
> >          ServerSocket rSocket = new ServerSocket(SERVLET_PORT);
> >          System.out.println(rSocket.getLocalPort());
> >      }
> >      catch(Exception e)
> >      {
> >      }
> >
> >    }
> >}
> >Thanks for your problem,
> >vijaya
>
> ______________________________________________________
> Get Your Private, Free Email at http://www.hotmail.com
>
> __________________________________________________________________________
> _
> 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
>

___________________________________________________________________________
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