This week's book giveaway is in the Other Languages forum.
We're giving away four copies of Functional Reactive Programming and have Stephen Blackheath and Anthony Jones on-line!
See this thread for details.
Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

can applications access servlets?

 
Stanley George
Ranch Hand
Posts: 55
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hell friends
i am new to servlets. i have written a code for chat application in swing..server & client.
i have to supply the server's ip address to the client evetime i start a chat.
i wish avoid this and have the server ip address fixed. is it possible using a servlet (instead of the seever app.) at a fixed ip address?
please help (anything!).
thanking you.
 
Stanley George
Ranch Hand
Posts: 55
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hello friends..
just wanted to add that mine is a standalone client-server application
thanx
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13074
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you are not using a web browser for the client and a web server on the server side, and want to do direct socket communication, why bother with servlets at all?
Bill
 
Stanley George
Ranch Hand
Posts: 55
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanx bill
i am just not using a web browser for the client ..
i am still undecided about the server part..can i have the same client and use servlets? what i want is something like icq..in that case how can i communicate with a servelet? or are servelets what i even need? kindly advice
thanx
stans
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13074
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There are plenty of alternatives, thats for sure.
You could write a server - listening at some known IP address and port and have your client talk directly to the server.
Servlets are very specialized and you would not want to try to make the same servlet do both HTTP and "some socket" communication. You could have support classes that were common to both.
One reason to use HTTP protocols and a servlet is that proxy servers and firewalls generally don't block HTTP messages. Servlets also have handy "session" keeping capability.
In my servlets book I do several simple chat servers using various configurations.
Bill

------------------
author of:
 
Stanley George
Ranch Hand
Posts: 55
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanx A LOT bill
u have cleared some fundamentals for me.
i am more focussed now..my needs are:
1> a non-browser client (standalone)
2> a server that can be hosted anywhere (need not be standalone)
i want to be able to host my server on any commercial hosting site...(this is the part where i need help badly)
3> the server for just knowing the ip address of users who have logged on.
4> direct socket communication between the users once i get the ip address from the server
5> your book ;-)
can i achieve the above?
thanx
stans
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13074
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"2> a server that can be hosted anywhere (need not be standalone)
i want to be able to host my server on any commercial hosting site...(this is the part where i need help badly)"
Since that is the trickiest part, I would certainly start by talking to potential hosts about the kind of services they are willing to host.
If you are determined to stay away from servlets and work with sockets, what you really need is a book on general Java networking. One nice one is "Java Distributed Computing" by Jim Farley published by O'Reilly
Bill
 
Stanley George
Ranch Hand
Posts: 55
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hey bill
thanx for all the help
its not that i am reverse to servlets...i just wanted to esplore all possibilities and socket communication seeemed to be the simplest (many examples online
i sure will follow what u have said.
thanx
stans
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic