Solved

Deamonprogramming Linux vs Windows NT

Posted on 1998-04-26
4
153 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
Comment Utility
What exactly is the problem?  Are you trying to do it on NT or on Linux?
0
 

Author Comment

by:tord_f
Comment Utility
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
Comment Utility
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
Comment Utility
Thanks
0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

IntroductionThis article is the second in a three part article series on the Visual Studio 2008 Debugger.  It provides tips in setting and using breakpoints. If not familiar with this debugger, you can find a basic introduction in the EE article loc…
This article shows you how to optimize memory allocations in C++ using placement new. Applicable especially to usecases dealing with creation of large number of objects. A brief on problem: Lets take example problem for simplicity: - I have a G…
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.

763 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

6 Experts available now in Live!

Get 1:1 Help Now