File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Sockets and Internet Protocols and the fly likes URLConnection problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Sockets and Internet Protocols
Bookmark "URLConnection problem" Watch "URLConnection problem" New topic

URLConnection problem

Nehal Dave

Joined: Dec 22, 2000
Posts: 28
Hello Friends,
I am making a chat applet server application. I have made it with Sockets but as socket doesnt work behind proxies ( till i know, if you know how to get a socket in an applet to work behind a firewall then it will solve all my problem.) But rite now i am trying to work with URLConnection. I open up a new urlconnection from the applet & connect it to the server at port say 1234. I store the output & input streams of the URLConnection & then by using 2 different threads i read & write to the server. I can read all the messages sent by server through input stream of urlconnection. But i just can send only one message through the output stream of urlconnection. why am i not able to send mulitple messages using a thread through the output stream of urlconnection?? Please help me out with it. If code needed please let me know Ill paste it... its a bit long one.Thanking you in advance.
Carl Trusiak

Joined: Jun 13, 2000
Posts: 3340
If you are using the http protocal and a servlet to provide the server side, http is a sessionless protocal and that could be the source of your problem. If you want a chat search and you could find one that over comes this problem. I believe there is one at JFind just click the link below.

I Hope This Helps
Carl Trusiak, SCJP2, SCWCD
Nehal Dave

Joined: Dec 22, 2000
Posts: 28
Hi Carl,
Thanks for the reply.. but where is the link? & i am not using servlet. I am using a java application which runs 24hrs/365 days.. All i want to know is can you send multiple messages ( strings ) using URLConnection's output stream??
please post the link
Thanks once again for your effort.
I agree. Here's the link:
subject: URLConnection problem