Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.os.linux.development.apps > #307
| Path | csiph.com!x330-a1.tempe.blueboxinc.net!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!eternal-september.org!feeder.eternal-september.org!mx04.eternal-september.org!.POSTED!not-for-mail |
|---|---|
| From | Bill M <wpmccormick@gmail.com> |
| Newsgroups | comp.os.linux.development.apps |
| Subject | socket client thread |
| Date | Mon, 12 Dec 2011 16:31:44 -0600 |
| Organization | A noiseless patient Spider |
| Lines | 26 |
| Message-ID | <jc5vcg$da4$1@dont-email.me> (permalink) |
| Mime-Version | 1.0 |
| Content-Type | text/plain; charset=ISO-8859-1; format=flowed |
| Content-Transfer-Encoding | 7bit |
| Injection-Date | Mon, 12 Dec 2011 22:31:44 +0000 (UTC) |
| Injection-Info | mx04.eternal-september.org; posting-host="ep43mLzI/jofXxL2elOFPA"; logging-data="13636"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/o1n+odEc880nMt7J84nbDA3iUd7QJkPk=" |
| User-Agent | Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.23) Gecko/20110920 Thunderbird/3.1.15 |
| Cancel-Lock | sha1:EXdGTpYXdHGYY5GRSwbncNC8P4Q= |
| Xref | x330-a1.tempe.blueboxinc.net comp.os.linux.development.apps:307 |
Show key headers only | 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 | Next — Next in thread | Find similar
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