chat program without sockets
I wrote a small chat program that pairs sockets together and the server just sends the messages back and forth. It turns out that the server I have access to will not give me access to a private port to which I can bind a serversocket.
Does anyone know another good way of writing a chat program without using sockets in a webserver (Tomcat/Resin) environment. I was told that writing the socket in a command line app could solve that problem but I'm not sure how to run that from a webserver (ie - you still need to provide a port number when creating the serversocket). Anyone understand how to do this?
I heard SOAP or REST is a good way but I don't understand how it keeps track of all the client 'pairs'. Any help is greatly appreciated.
[765 byte] By [
uberallesa] at [2007-11-26 15:39:46]

here is a good way to write a chat program without using sockets:
every time you want to send something you write it to a file,
other peers constantly monitor this directory where you write the file,
they open the file and check if the message is for them.
if its for them, they read the file and delete it.
this method has its advantages:
- no internet connection is required
- you dont need to use complicated sockets
and disadvantages:
- everyone who is using the the chat must use the same computer.
> - everyone who is using the the chat must use the> same computer.Sort of defeats the purpose, doesn't it? :)
> > - everyone who is using the the chat must use the> > same computer.> > Sort of defeats the purpose, doesn't it? :)it doesnt defeat the purpose of "not using sockets", which happens to be the question.
> > > - everyone who is using the the chat must use
> the
> > > same computer.
> >
> > Sort of defeats the purpose, doesn't it? :)
>
> it doesnt defeat the purpose of "not using sockets",
> which happens to be the question.
I meant the purpose of using a chat program when you're sitting next to the person.
> > > > - everyone who is using the the chat must use
> > the
> > > > same computer.
> > >
> > > Sort of defeats the purpose, doesn't it? :)
> >
> > it doesnt defeat the purpose of "not using
> sockets",
> > which happens to be the question.
>
> I meant the purpose of using a chat program when
> you're sitting next to the person.
what if both of you are deaf? and cant use sign language?
you really should be more accepting of others.
>what if both of you are deaf? and cant use sign language?
>you really should be more accepting of others.
Dang what people make up excuses to be right instead of admitting their idea was kind of useless for that kind of purpos. Even though its good knowledge its not much use here.
Actually web servers use sockets too. If you don't use sockets then there's no way for the chatters to be on different computers, and as stated there's no point in that.
But no doubt the OP really meant "Is it possible to write a chat application using servlets and JSPs?" Which it is, although you'd need a big chunk of Ajax on the client side to make it look like a classic chat application. The dedicated chat server is a much better design.
> >what if both of you are deaf? and cant use sign
> language?
> >you really should be more accepting of others.
>
> Dang what people make up excuses to be right instead
> of admitting their idea was kind of useless for that
> kind of purpos. Even though its good knowledge its
> not much use here.
http://www.m-w.com/dictionary/sarcasm
Why would I be writing a chat program for one computer?
> Why would I be writing a chat program for one> computer?See reply 8.