On 11 Aug 2012, at 20:42, Elias Kopsiaftis <yemi...@gmail.com> wrote:
> I posted about this a bit earlier, and I was told WebSockets were a better > approach, but I am wondering is what I am trying to do even possible? My > idea is to create a program that allows two users to connect through the > server, and send images and text to each other. for the server, i have two > servlets, one that uses comet, and one that does not. the regular servlet > listens for requests, and broadcasts them to all the available connections. > the comet servlet listens for connections, and once a connection is made, > stores the response in a singleton that both the regular servlet and comet > servlet have access to. the way its supposed to work is that the comet > servlet stores the response to all connected, the regular servlet listens > for messages, and once it receives one, gets a reference to the singleton, > goes through all its responses, and sends the message to each connection. i > can get my client to connect to the comet servlet just fine, via the tomcat > logs, but i cant get it to connect at all to the regular servlet and i dont > know why. when i print out the url used to connect to the regular servlet > and use the browser, i am not getting any server errors, so it looks like > it connects just fine, but none of my print statements in the inputservlet > ever get executed, meaning it never processes. now i am wondering, is this > idea even possible with the technology available in comet? None of the above sounds like a good idea. Use Comet/WebSockets and a message broker - the pattern you are looking for is called publish-subscribe. For open source brokers you can either use something like Apache ActiveMQ or RabbitMQ. p > > --bcaec550b36ca57b5304c702a778-- --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org