Solved

Deamonprogramming Linux vs Windows NT

Posted on 1998-04-26
4
155 Views
Last Modified: 2010-04-10
Hi
I am writing a program for companies who want to plan their workers time. The program communicate with a serverprogram on a Linuxmachine on a TCP/IP-port similar to a www-server and client.

I hope that anyone have a piece of code, with comments that describe how a connection starts, sends and finally closes. It's a twoway-connection, the server can do the same thing with the client.

Thanks Tord
0
Comment
Question by:tord_f
  • 2
  • 2
4 Comments
 
LVL 11

Expert Comment

by:alexo
ID: 1164268
What exactly is the problem?  Are you trying to do it on NT or on Linux?
0
 

Author Comment

by:tord_f
ID: 1164269
Its a client-server application. The clients is running Windows NT and connect to the serverprogram on a Unix or Linux machine. It's a demon like the httpd-process.

The serverprogram is responsibli for the database files, locking, user administration and other things.

The client is  graphical interface who presents the result to the user who in turn manipulate the database on the server.

It's working lika a www-connection. The server wait for a connection on a TCP-port and when a client connect to that port i communicate with that client an then close the connection.

But I dont know how to write that piece of code that wait, connect and wait.....

I am looking at Apache sourcecode but it's complex. I hope I can get it clear in this site and the answer show me the piece of code that is neccesary for full functionality.
0
 
LVL 11

Accepted Solution

by:
alexo earned 300 total points
ID: 1164270
I suggest you find a good reference about socket programming.  I can refer you to some "winsock" sites (the windows implementation of sockets, very similar to the unix "berkley" sockets if you ignore the MS additions):
  http://www.sockets.com
  http://www.winsock.com
  http://www.goodnet.com/~esnible/winsock.html

In general, check the listen() and accept() functions.
0
 

Author Comment

by:tord_f
ID: 1164271
Thanks
0

Featured Post

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Introduction This article is a continuation of the C/C++ Visual Studio Express debugger series. Part 1 provided a quick start guide in using the debugger. Part 2 focused on additional topics in breakpoints. As your assignments become a little more …
Container Orchestration platforms empower organizations to scale their apps at an exceptional rate. This is the reason numerous innovation-driven companies are moving apps to an appropriated datacenter wide platform that empowers them to scale at a …
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.

813 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now