开发者

Creating a server and client program like online reservation program using socket API in C

I need some help in figuring out the design principle for this program. I donot expect progamming code but rather some design and architecture theory.

I am programming in C language using Socket API. I want to know how SQL datab开发者_如何学Pythonase, Socket API, other language, etc are needed to complete it. If possible without lot of hassle, I want to upload on webserver. I appreciate for you help.

Thanks.


Make small library that has wrapper functions for socket API, another library for SQL database access, and anything else you might use. These libraries should do error handling, among any other thing you might do. Emit some diagnostics and decide whether to continue or abort the program, and do it. Build and test these libraries.

Then write your program, that is, reading and writing to the database and network and anything else you might add. Link against your libraries when building.

This program, from what I understand from the question, is going to listen on a port for incoming connections, fork a thread (or process), and keep listening. The child process will decide what to read or write and whether to network or database.

I hope this is simple for enough for the homework to get you started.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜