Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.os.linux.development.apps > #307

socket client thread

From Bill M <wpmccormick@gmail.com>
Newsgroups comp.os.linux.development.apps
Subject socket client thread
Date 2011-12-12 16:31 -0600
Organization A noiseless patient Spider
Message-ID <jc5vcg$da4$1@dont-email.me> (permalink)

Show all headers | View raw


Hello,

I'm working on socket client/server apps where the client app starts the 
connection on a separate pthread and then sits in a loop to send messages.

The problem I'm having is finding how to kill the client app when the 
server dies. If I use telnet has the client, he does exit.

So, in pseudo-code ...

start_client() //starts client connection on another thread

while(!quit && connected) {
	
   message = get_user_message

   //this blocks
   reply = send_message_to_server(message)

   print(reply)
		
}

  ...

What is the usual method to know the server is still alive?

Back to comp.os.linux.development.apps | Previous | NextNext in thread | Find similar


Thread

socket client thread Bill M <wpmccormick@gmail.com> - 2011-12-12 16:31 -0600
  Re: socket client thread David Schwartz <davids@webmaster.com> - 2011-12-12 18:35 -0800
  Re: socket client thread Jasen Betts <jasen@xnet.co.nz> - 2011-12-13 11:46 +0000
    Re: socket client thread Bill M <wpmccormick@just_about_everywhere.com> - 2011-12-13 15:32 -0600

csiph-web