1. Socket synchronization and Asynchronization
This code is reached during synchronization.
Tcpclient. receive ();
Will not be executed downward,
It is a kind of infatuation,
Tcpclient. beginreceive ();
It belongs to the kind of everything. Of course it is good, and it doesn't matter if it doesn't exist,
The one that won't survive ..
Synchronization It is a single thread. You can do the next step only after completing one step. If you are blocked in the first operation, such as network latency, you must wait.
While Asynchronization is multi-thread, enabling Asynchronization Method A new thread is created for processing, and the main thread continues to run. After the Asynchronous Method is completed, the callback function can be started to return the result to the main thread.
To put it simply:
Synchronization is always waiting to return
Asynchronous processing means that other processing is performed first, regardless of whether the response is returned.