.


:




:

































 

 

 

 


Socket System.Net.Sockets

AddressFamily Socket.AddressFamily
Available .
Blocking
Connected ,
LocalEndPoint
ProtocolType
RemoteEndPoint
SocketType

Socket

Accept()
Bind ()
Close ()
Connect ()
Listen () .
Receive ()
Select ()
Send ()
Poll ()
SetSocketOption
Shutdown ()

 

1: .

, , . , <The End>.

:

. IPEndPoint , IP , Dns.Resolve (), . localhost, 11000.

 

 

AddressFamaly .

SocketType :

Dgram . Dgram Udp InterNetwork .
Raw .
Stream . InterNetwork .

 

Bind (). , , .

, .

try

{

sListener.Bind(ipEndPoint);

, .

sListener.Listen(10);

, .

, Accept(). . . , . . , Accept().

 

//

, , Send () Receive().

 

 

Receive() , . .

, , .

, .

Close (). , , Shutdown().

, Close ().

 

SocketShutdown , .

 

Both
Receive
Send

 

Close (), Connected false.


.

, , , .

.

 

, Connect () , . , .

 

2: .

localhost , , SocketException.

:

  • IP .
  • .
  • . ( try)
  • .
  • .
  • .
  • (catch), SocketException
  • 10061, ,

 

3: , .

4: .

 

:

  1. ?
  2. , ?
  3. , ?
  4. .
  5. .
  6. Socket.
  7. ?
  8. ?
  9. ?


<== | ==>
- | -
:


: 2016-11-02; !; : 494 |


:

:

- , , .
==> ...

1513 - | 1328 -


© 2015-2024 lektsii.org - -

: 0.014 .