Solved

Keep connection alive

Posted on 1999-01-12
5
191 Views
Last Modified: 2013-11-20
I am writing a client and server, similiar to the samples provided with VC++ 5. I don't want my server to have any dialogs, windows, etc. I just want it to listen for a connection, make the connection to the client, and receive messages. So far i have been able to write the code to listen and accept a connection. But once the connection is made the server program ends. how do i keep the server running?
0
Comment
Question by:GreatOne
  • 2
  • 2
5 Comments
 
LVL 4

Expert Comment

by:nil_dib
ID: 1327584
Do you instance a thread for each incoming connection?
0
 

Author Comment

by:GreatOne
ID: 1327585
Im not sure if i instanced a thread. how would i check? and i only want the server to accept one connection, for now. does that make a difference?
0
 
LVL 4

Expert Comment

by:nil_dib
ID: 1327586
I think you should post the code snippet where the server accepts the connection  .....
0
 

Author Comment

by:GreatOne
ID: 1327587
I have figured out part of my problem. I wrote my server using a dialog-based application wizard. The program listens for a connection when the dialog box appears. SO is there anyway to make the dialog box invisible?

0
 
LVL 3

Accepted Solution

by:
_Scotch_ earned 70 total points
ID: 1327588
Just reviewing old questions... You asked how to make a dialog
invisible...

You can do this with ShowWindow(FALSE) but then you can never
get it back unless somewhere in your code you have ShowWindow(TRUE)...

You can also just iconify yourself with ShowWindow(SW_MINIMIZE)
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

In this article, I'll describe -- and show pictures of -- some of the significant additions that have been made available to programmers in the MFC Feature Pack for Visual C++ 2008.  These same feature are in the MFC libraries that come with Visual …
Introduction: Ownerdraw of the grid button.  A singleton class implentation and usage. Continuing from the fifth article about sudoku.   Open the project in visual studio. Go to the class view – CGridButton should be visible as a class.  R…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…

912 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

21 Experts available now in Live!

Get 1:1 Help Now