cancel
Showing results for 
Search instead for 
Did you mean: 

Re: Cleint-Server Question

 
SOLVED
Go to solution
Becke
Super Advisor

Cleint-Server Question

Guys couple of questions,

When a client and server applications are installed on the same host,

Q, Do they need to use ports to talk to each other? does it have to use tcp/ip?

Qestion 2. How does a server knows and fulfils client's request on the same host?

Please let me know

Cheers
Raf
27 REPLIES 27
njia_1
Trusted Contributor
Solution

Re: Cleint-Server Question

Hi

For communications between application on same host there are few different way to implement the IPC (inter process communication) TCP/IP is one of the commond methods. Others like pipes, FIFOs(named pipes) and for system V there are few more like message queues, Semaphores and Shared Memory.
Do a search on google interprocess communication and you will find a lot of information.

second question,

Usually there is a communication protocol being used by both clients and servers like HTTP, FTP this protocol defines commands, data structures format how to handle errors and which port server should listen on, etc etc. Everything is already defined before client can talk to server and server can process any requests from clients. Just like if you only speack English, you can only talk to someone speaks English as well. In this case, English is the protocol.
A. Clay Stephenson
Acclaimed Contributor

Re: Cleint-Server Question

When on the same host, the client/server do not have to use ports to communucate with each other. That can use named pipes, IPC messages, a simple file, or even shared memory. However, it's very common to use tcp ports local-to-local as well as local-to-remote client/server pairs. After all, why use two methods and invent the wheel twice when one method will work?
If it ain't broke, I can fix that.
Arunvijai_4
Honored Contributor

Re: Cleint-Server Question

Hi Raf,

Q1, Do they need to use ports to talk to each other? does it have to use tcp/ip?

Not necessarily TCP/IP, It can be any of IPC methods like, named pipes, fifo, etc.. Also, they can communicate via TCP/IP as well.

2. How does a server knows and fulfils client's request on the same host?

There maynot be any difference between same host and others(sometimes, may be). After all,
It(Server) is designed to serve to the clients.

-Arun
"A ship in the harbor is safe, but that is not what ships are built for"
Becke
Super Advisor

Re: Cleint-Server Question


Thanks Guys for your quick responses, I'm doing lot of reading on the internet to gain appropriate knowledge, I will be getting back with some more questions once I'm finished with my reading...

Thanks a lot, I will assign points soon...
Becke
Super Advisor

Re: Cleint-Server Question


Guys,

When client-server is talking to each other on the same host using tcp/ip, then what is the example of using TCP/IP on the same host?? is it when it uses ports to communicate each other or something else???
Bharat Katkar
Honored Contributor

Re: Cleint-Server Question

Hi Raf,
Find attached doc on Network Ports.
Thought this could be helpful.
Regards,
You need to know a lot to actually know how little you know
Arunvijai_4
Honored Contributor

Re: Cleint-Server Question

Hi Raf,

You asked,

When client-server is talking to each other on the same host using tcp/ip, then what is the example of using TCP/IP on the same host?? is it when it uses ports to communicate each other or something else???

It depends, for example, you are running Apacher server on HP-UX and using Mozilla in the same host, you request a page or doing kernel tuning with kcweb. Thsese stuffs can't be done thro' other IPC mechanisms.

Hope this is clear.

-Arun
"A ship in the harbor is safe, but that is not what ships are built for"
njia_1
Trusted Contributor

Re: Cleint-Server Question

Hi there

Not sure about your last question, if you just want to see an exmaple of two programs talking to each other using TCP/IP but they both running on the same host. The quickest example is try this

# telnet localhost

and then try

# netstat -a | grep telnet

and you will see something like following

netstat -a | grep telnet
tcp 0 0 localhost.58746 localhost.telnet ESTABLISHED
tcp 0 0 localhost.telnet localhost.58746 ESTABLISHED
tcp 0 0 *.telnet *.* LISTEN
tcp 0 0 primux.telnet .59217 ESTABLISHED

It tells you that there is a TCP/IP connection been established betweel localhost, port 58746 and localhost 23(telnet)
Arunvijai_4
Honored Contributor

Re: Cleint-Server Question

Hi Raf,

Here is a good link describes about a typical C&S app.

http://penguin.dcs.bbk.ac.uk/academic/networks/application-layer/client-server/index.php

-Arun
"A ship in the harbor is safe, but that is not what ships are built for"