LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 03-31-2004, 03:48 AM   #1
tushar123
LQ Newbie
 
Registered: Dec 2003
Location: mumbai
Distribution: shivatusahr
Posts: 14

Rep: Reputation: 0
Question Tcp/ip Client Server Problem


I have 4 modules :
1. command line interpreter ( CLI )
2. Requestprocessor ( REQPRO )
3. RequestHandler. ( REQHAND)
4. GUI
RequestProcessor (REQPRO ) interact with CLI on TCP/IP. i.e. interface between REQPRO and CLI is TCP/IP similarly
interface between REQPRO and REQHAND is also TCP/IP ,
GUI and REQHAND interact using TCP/IP.

[ CLI ] -------------------[ REQPRO ] ---------[ REQHAND ]---------[ GUI ]
---->Request-----------> <--------Request-------


1. CLI module act as a client and take command from user and pass is on TCP/IP to the REQPRO
which process request and send reply back to CLI.
2. REQHAND takes request from GUI and process it. If there are some critical requests then REQHAND send that
request to REQPRO
and REQPRO process that request and send the result to REQHAND and then REQHAND send back result to the GUI.
The REQHAND and REQPRO will communicate i.e. if i keep REQPRO as server and REQHAND as client then if REQPRO will down
REQHAND will also down.
but i want that REQHAND will always up ( not as client )
so tell me proper mid so that i will choose proper module as client and sever.

I am using C++/Solaris
 
Old 03-31-2004, 02:47 PM   #2
Mara
Moderator
 
Registered: Feb 2002
Location: Grenoble
Distribution: Debian
Posts: 9,696

Rep: Reputation: 232Reputation: 232Reputation: 232
I think you can have both REQPRO and REQHAND as daemons (will probably require two ports so that every one on them can listen). When they're separate processes you can turn them on and off any time. Then CLI and GUI will be clients.
 
Old 03-31-2004, 05:16 PM   #3
aluser
Member
 
Registered: Mar 2004
Location: Massachusetts
Distribution: Debian
Posts: 557

Rep: Reputation: 43
I would tend to have one program pipe() twice and fork() to become the REQPRO and REQHAND. Then you have only one executable to start and you don't use up any extra tcp port numbers.

What is the reason for having the separate daemons? If the cli and gui make similar requests, you should probably have them appear exactly the same to the daemon.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Multithreaded TCP Client examples daveseff Programming 1 03-31-2005 11:29 PM
tcp/ip programming client side gajaykrishnan Linux - Networking 2 07-29-2004 11:58 PM
problems with TCP client devit Programming 2 05-29-2004 10:35 PM
how to do testing TCP/IP client/sever appl Madhukar Linux - Networking 0 05-26-2004 09:01 AM
Server/Client-commucation via TCP-Sockets cYbORg Programming 5 05-18-2003 06:01 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 04:05 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration