Networks in .net / C #

Can someone please point me in the right direction to find out how to do network operations in C # /. NET 3.5? Code samples and explanations are welcome. I am mainly looking for how to make asynchronous / multithreaded server / client models.

It’s quite convenient for me to build on how to do this in C ++ with WinSock, but despite the fact that all my research cannot understand this concept in C #.

Thanks for any help you can provide :)

+3
source share
3 answers

WCF , . ZeroC . , .

TcpClient/UdpClient

. . async NetworkStream (BeginRead ..). , , , .

Socket -

- IO . .

Socket - APM

(AKA IAsyncResult, Begin/End Style) - . . , async (, BeginReceive) :

  • IAsyncResult ( ).
  • WaitHandle IAsyncResult, .
  • BeginXXX , .

# 3, . , .

:

.NET 3.5

.NET 3.5 , . "" (, Socket.SendAsync). , , , IAsyncResult SocketAsyncEventArgs. , SocketAsyncEventArgs IO. , APM. , , , , .. , .

APM, SocketAsyncEventArgs/Async. CompletionPorts WinSock, , CompletionPorts .

+17

.NET 3.5 Windows Communication Foundation -.NET framework .

:

( WCF)

WCF StackOverflow WCF

+3

, .

, Windows Communication Foundation.

, System.Net.Sockets.Socket.

+1

Source: https://habr.com/ru/post/1698378/


All Articles