Assume that an application waits for connection :
        ServerSocket s = new ServerSocket(8088);
        Socket clientSocket = serverSocket.accept();

    A Servlet want to make connection:
            PrintWriter pw = response.getWriter();
            Socket clientSocket = new Socket(hostAddress, 8088);
            pw.println("<HTML>");
            pw.println("<BODY>");
            pw.println("hello!");
            pw.println("</BODY>");
            pw.println("</HTML>");



     Nothing more is in doGet or doPost method.

    I call servlet from browser, servlet prints hello and stops. However,
application still waiting connection.

    Thanks,






----- Original Message -----
From: "Christopher K. St. John" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, September 21, 2001 9:11 PM
Subject: Re: Socket connection is servlet


> Fusun CITAK wrote:
> >
> > I must connect with this application from a servlet.
> > Is that possible?
> >
>
>  Yes.
>
>
> > What is wrong?
> >
>
>  Without details, it's a little hard to tell. If
> you can't post your code, at least post any error
> messages you're getting. Or something.
>
>
>
> --
> Christopher St. John [EMAIL PROTECTED]
> DistribuTopia http://www.distributopia.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