Solved

Deamonprogramming Linux vs Windows NT

Posted on 1998-04-26
4
158 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Errors will happen. It is a fact of life for the programmer. How and when errors are detected have a great impact on quality and cost of a product. It is better to detect errors at compile time, when possible and practical. Errors that make their wa…
Written by John Humphreys C++ Threading and the POSIX Library This article will cover the basic information that you need to know in order to make use of the POSIX threading library available for C and C++ on UNIX and most Linux systems.   [s…
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.

717 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