Click here to Skip to main content
16,014,838 members
Home / Discussions / C#
   

C#

 
AnswerRe: Contrast problem Pin
pancakeleh15-Nov-10 19:05
pancakeleh15-Nov-10 19:05 
GeneralRe: Contrast problem Pin
pancakeleh15-Nov-10 21:34
pancakeleh15-Nov-10 21:34 
GeneralRe: Contrast problem Pin
Caslen16-Nov-10 2:46
Caslen16-Nov-10 2:46 
GeneralRe: Contrast problem Pin
pancakeleh16-Nov-10 3:53
pancakeleh16-Nov-10 3:53 
Questionhistogram control Pin
pancakeleh15-Nov-10 16:44
pancakeleh15-Nov-10 16:44 
AnswerRe: histogram control Pin
Dr.Walt Fair, PE15-Nov-10 17:39
professionalDr.Walt Fair, PE15-Nov-10 17:39 
QuestionAsync vs Sync Pin
Jacob D Dixon15-Nov-10 14:03
Jacob D Dixon15-Nov-10 14:03 
AnswerRe: Async vs Sync Pin
Luc Pattyn15-Nov-10 14:54
sitebuilderLuc Pattyn15-Nov-10 14:54 
Hi Jacob,

this is how I see it:

1.
there are no synchronous or asynchronous sockets, all sockets are the same; however you can operate them in sync or async way; you can choose your way separately for clients and servers.

2.
you can always mimic an async operation by launching a separate thread that works synchronously. The disadvantage is cost (one more thread, with its state and stack), the advantage is comfort, as you have less of a problem remembering your state.

3.
The .NET Socket class supports ReceiveTimeout in sync mode only; when using the async methods, if you want some kind of timeout, you have to implement it yourself. And even then, it will not pre-empt an outstanding async Receive, all it will do is tell your app sooner the data isn't coming (in time).

4.
Assuming your client is using only one or a few sockets at any point in time, I don't see much objections to using the thread and sync mode there. On the server side, the potential number of clients may force you to work in async mode.

Hope this helps.
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles] Nil Volentibus Arduum
Please use <PRE> tags for code snippets, they preserve indentation, and improve readability.


GeneralRe: Async vs Sync Pin
Jacob D Dixon15-Nov-10 17:21
Jacob D Dixon15-Nov-10 17:21 
AnswerRe: Async vs Sync Pin
Luc Pattyn15-Nov-10 17:31
sitebuilderLuc Pattyn15-Nov-10 17:31 
GeneralRe: Async vs Sync Pin
Jacob D Dixon16-Nov-10 13:54
Jacob D Dixon16-Nov-10 13:54 
GeneralRe: Async vs Sync Pin
Luc Pattyn16-Nov-10 13:57
sitebuilderLuc Pattyn16-Nov-10 13:57 
QuestionAccessing form controls from WCF service Pin
teknolog12315-Nov-10 10:29
teknolog12315-Nov-10 10:29 
AnswerRe: Accessing form controls from WCF service Pin
Dave Kreskowiak15-Nov-10 10:49
mveDave Kreskowiak15-Nov-10 10:49 
AnswerRe: Accessing form controls from WCF service Pin
DaveyM6915-Nov-10 13:00
professionalDaveyM6915-Nov-10 13:00 
AnswerRe: Accessing form controls from WCF service Pin
PIEBALDconsult15-Nov-10 14:22
mvePIEBALDconsult15-Nov-10 14:22 
AnswerRe: Accessing form controls from WCF service Pin
si2480315-Nov-10 22:45
si2480315-Nov-10 22:45 
GeneralRe: Accessing form controls from WCF service Pin
teknolog12316-Nov-10 3:17
teknolog12316-Nov-10 3:17 
AnswerRe: Accessing form controls from WCF service Pin
si2480316-Nov-10 4:51
si2480316-Nov-10 4:51 
GeneralRe: Accessing form controls from WCF service Pin
teknolog12318-Nov-10 7:34
teknolog12318-Nov-10 7:34 
AnswerRe: Accessing form controls from WCF service Pin
Daniel Vaughan15-Nov-10 23:41
Daniel Vaughan15-Nov-10 23:41 
Question"No connection could be made because the target machine actively refused it" Pin
Megidolaon14-Nov-10 22:31
Megidolaon14-Nov-10 22:31 
AnswerRe: "No connection could be made because the target machine actively refused it" Pin
Manfred Rudolf Bihy14-Nov-10 22:49
professionalManfred Rudolf Bihy14-Nov-10 22:49 
GeneralRe: "No connection could be made because the target machine actively refused it" Pin
Megidolaon14-Nov-10 22:56
Megidolaon14-Nov-10 22:56 
GeneralRe: "No connection could be made because the target machine actively refused it" Pin
Manfred Rudolf Bihy14-Nov-10 22:58
professionalManfred Rudolf Bihy14-Nov-10 22:58 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.