• 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

client to server

 
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
please i am new to this aspect, i do i connect client to a server
 
Ranch Hand
Posts: 3271
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by kaffo lekan:
please i am new to this aspect, i do i connect client to a server


There are a number of ways to do this, but my preference is to use RMI (Remote Method Invocation). You can find the API specs on it here.
Basically, it allows you to treat the remote object, your server, as if it was a local object. Then, connecting to it is almost trivial.
If you want to look into RMI some more, i'd suggest checking out Java Enterprise in a Nutshell.
Corey
 
Ranch Hand
Posts: 1365
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Part one: Pull yourself together. What is it you want to do? The closest thing to english I can get out of that is: how do i connect client to a server. Any particular type of client/server you're dealing with? If you just want to open a socket and feel that the Sockets and Internet Protocols forum wasn't the right place to ask, then here's some quick example code:
 
Ranch Hand
Posts: 243
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I would use RMI (Remote Method Invocation) also. I find it much easier than using sockets. But it also depends on what you want to do. What exactly are you trying to accomplish? Do you have any specific details?
 
Ranch Hand
Posts: 356
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Your question is very generic. And all the methods given above are definite client server techinques. Here are some more.
1. You have a fat client which talks to a database using JDBC/ directly using db protocols . That is a client server communication
2. You use a browser and use http to talk to a servlet running in a web-app server. That is also client server communication.
3. You use a client which invokes EJBs deployed in an application server.
4. You use RMI
5. You talk to a server directly using TCP or UDP sockets.
6. You talk Http to an web server over a TCP socket...
This list can go on and on. Unless you be a little more specific with your requirements.

------------------
Shubhrajit
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic