Help coderanch get a
new server
by contributing to the fundraiser
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

URLConnection problem

 
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
Cheers
Nehal.
 
Sheriff
Posts: 3341
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Nehal Dave
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
But how did the elephant get like that? What did you do? I think all we can do now is read this tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/t/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic