-
Socket connection -Applet Servet Comm thru Java Web server
I have created a thread at a servlet oaded on java web server to accept
socket connection from applets(which try to socket connect) at a specified
port no..This non http communication is not accepted and serviced .i am
getting connection refused connectException at applet side?
thanks in advance
anand
-
Re: Socket connection -Applet Servet Comm thru Java Web server
"anand" <anandakrishnani@rediffmail.com> wrote:
>
>I have created a thread at a servlet oaded on java web server to accept
>socket connection from applets(which try to socket connect) at a specified
>port no..This non http communication is not accepted and serviced .i am
>getting connection refused connectException at applet side?
>thanks in advance
>anand
i thought that servlets are only running when requested by a client,
like CGI scripts or similar. (I assume so, but I'm not sure.)
So your port will only be listened to by the servlet, if the servlet was
requested in an http-request earlier and is still running.
You can start a http request within your applet by creating an new
instance of java.io.URL and connect it via URL.getInputStream().
And afterwards, you can connect to the port.
You also try to ensure that the port is open by telnetting to it or
using having your webbrowser trying to load http://hostname ortnum/
good luck,
Daniel Strecker
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks