LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
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 12-11-2003, 11:34 AM   #1
ilie
LQ Newbie
 
Registered: Dec 2003
Distribution: Mandrake
Posts: 3

Rep: Reputation: 0
A simple Unix server


Hello,
I have to make a small project for my university.. the app has to do this.. I have a client for my server.. and my server is in turn a client for a mysql server.. The client app has to access my server for data stored in a MySQL database.. my server has to then as client to the MySQL server.. get the data and then send to the client app. I have to write my server in C but I can use anything to write my client ( and I chose QT ). What I dream to do is have my server forward every communication that it receives from the client to the MySQL server and vice-versa.. this way I can have the client to my server act like a client to the MySQL server and I don't have to worry about communication protocol betwean my client and the server. Is this possible? Has anyone done it?
 
Old 12-11-2003, 12:02 PM   #2
Hko
Senior Member
 
Registered: Aug 2002
Location: Groningen, The Netherlands
Distribution: Debian
Posts: 2,536

Rep: Reputation: 111Reputation: 111
Quote:
What I dream to do is have my server forward every communication that it receives from the client to the MySQL server and vice-versa.
Why? MySQL already is a server.

You would be just opening another TCP socket that does nothing else than passing data to/from the TCP/UNIX-socket of the MySQL-server.

If your problem is that the MySQL-deamon doesn't listen to a TCP-socket, but only to a local UNIX socket, then you could remove the line "skip-networking" from the /etc/my.cnf or /etc/mysql/my.cnf file.
 
Old 12-12-2003, 01:46 AM   #3
ilie
LQ Newbie
 
Registered: Dec 2003
Distribution: Mandrake
Posts: 3

Original Poster
Rep: Reputation: 0
No the problem is that I have to write a server for a university project... it just so happens that this server has to move data betwean a mysql server and a client.. I thought the most simple way to do this was to use MySQL client API in the client for my server and my server will do nothing but forward the data to the MySQL client.. I have no intention of working just for fun... I just need to write a server that facilitates the communication betwean a client and a MySQL server.. I thought of this so that my server would get out of having to deal with a protocol betwean my client and my server and then anouther protocol betwean my server and MySQL.
 
Old 12-12-2003, 02:38 AM   #4
nephilim
Member
 
Registered: Aug 2003
Location: Belgium
Distribution: Debian (server), Kubuntu (desktop)
Posts: 248

Rep: Reputation: 30
Quote:
I thought the most simple way to do this was to use MySQL client API in the client for my server and my server will do nothing but forward the data to the MySQL client.
If you want to implement it that way, why don't you send your request directly to the db server?

I think the idea of the assignment is to set up a db server and an application server so that the client doesn't have to know anything about the db.

Suppose you implement it like you suggest, you create SQL statements in your client code and send them to the app server that passes them to the db server. When you decide to change your db for some reason, you will have to change all of your code and upgrade every client.

When you let the app server do the specific SQL handling and you decide to change your db, you only have to change it on the server.

I'm not saying your suggestion doesn't work, but it's bad design. If you won't lose points because of that, go for it anyway because it IS the easiest solution.
 
  


Reply



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
Mephis for Unix server Toxicity2099 MEPIS 4 10-02-2005 12:24 PM
Using linux as a jumpstart server for unix dorilevy Linux - General 2 09-14-2005 02:48 AM
windows virus on a unix server andyong Linux - Networking 1 08-17-2004 02:13 PM
access unix server, IP unknown eltongeoff Linux - Networking 4 07-01-2004 04:16 PM
Help! Unix server always reboots J_Szucs Linux - Newbie 4 04-26-2003 05:36 PM

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

All times are GMT -5. The time now is 06:25 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