Solved

Keep connection alive

Posted on 1999-01-12
5
189 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

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Introduction: Load and Save to file, Document-View interaction inside the SDI. Continuing from the second article about sudoku.   Open the project in visual studio. From the class view select CSudokuDoc and double click to open the header …
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
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.
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…

706 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

17 Experts available now in Live!

Get 1:1 Help Now