Hi,
I write a servlet listening a socket
to accept applet's request,but there is a error:
j a v a . n e t . B i n d E x c e p t i o n
: A d d r e s s i n u s e.
The following is the code:
public class UsersServlet extends HttpServlet
implements Runnable{
static int SERVLET_PORT=10000;
ServerSocket serverSocket; RandomAccessFile myfile; Thread mythread=new Thread(this); public void run(){ try{ serverSocket = new ServerSocket(SERVLET_PORT); while (true) handleClient(serverSocket.accept());
}catch(IOException
e){}
} public void init(ServletConfig config) throws ServletException { super.init(config); mythread.start(); } public void handleClient(Socket client){ new UserConnection(this, client).start(); Any suggetion is helpful to me.
Regards
Huyong
|
- Re: About BindException Huyong2k
- Re: About BindException Vijaya Mahalakshmi
- Re: About BindException Yong Hu