Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » U++ MT-multithreading and servers » how to exit from Socket.Read()
how to exit from Socket.Read() [message #20397] Mon, 16 March 2009 17:39 Go to next message
darthspawn is currently offline  darthspawn
Messages: 58
Registered: February 2009
Member
I have a thread that run until the socket is connected and read from it, but I don't have an answer from the server when I want to close the socket.
When my destructor is called my client chrash.. Is possible stop the read or do something that let me close the socket without errors? thanks

Samuele
Re: how to exit from Socket.Read() [message #20402 is a reply to message #20397] Tue, 17 March 2009 08:43 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
darthspawn wrote on Mon, 16 March 2009 12:39

I have a thread that run until the socket is connected and read from it, but I don't have an answer from the server when I want to close the socket.
When my destructor is called my client chrash.. Is possible stop the read or do something that let me close the socket without errors? thanks

Samuele


I think you should use non-blocking reads and/or select.

Mirek
Re: how to exit from Socket.Read() [message #20405 is a reply to message #20397] Tue, 17 March 2009 10:13 Go to previous messageGo to next message
darthspawn is currently offline  darthspawn
Messages: 58
Registered: February 2009
Member
What is non blocking read?
Re: how to exit from Socket.Read() [message #20418 is a reply to message #20405] Tue, 17 March 2009 21:22 Go to previous message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
Check some socket docs... (it is not really U++ specific).

Mirek
Previous Topic: Stop a thread
Next Topic: Listen data transfered from socket
Goto Forum:
  


Current Time: Fri Mar 29 16:12:10 CET 2024

Total time taken to generate the page: 0.01597 seconds