dotnet / dotnet/dotnet-api-docs
Document which SocketType is required for each ProtocolType
- Lingua principale
- C#
- Stelle
- 949
- Fork
- 1.7k
- Merge medio
- 2g 19h
- PR unite (30g)
- 52
Descrizione
[The documentation for the `Socket` constructor](https://docs.microsoft.com/en-us/dotnet/api/system.net.sockets.socket.-ctor?view=netframework-4.7#System_Net_Sockets_Socket__ctor_System_Net_Sockets_AddressFamily_System_Net_Sockets_SocketType_System_Net_Sockets_ProtocolType_) says:
> The `addressFamily` parameter specifies the addressing scheme that the `Socket` class uses, the `socketType` parameter specifies the type of the `Socket` class, and the `protocolType` parameter specifies the protocol used by `Socket`. The three parameters are not independent. Some address families restrict which protocols can be used with them, and often the `Socket` type is implicit in the protocol. If the combination of address family, `Socket` type, and protocol type results in an invalid `Socket`, this constructor throws a `SocketException`.
It doesn't explain how to find out which combination of the three parameters work together, except for "try it and see if it throws". I think this is not sufficient and that valid combinations for the three parameters should be documented.
---
#### Document Details
⚠ *Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.*
* ID: 3d2161f0-52ad-b8b3-bfce-1756759cb449
* Version Independent ID: 21d3c8da-b0bb-b4e5-6696-4b61a7e7dbe4
* Content: [Socket Constructor (System.Net.Sockets)](https://docs.microsoft.com/en-us/dotnet/api/system.net.sockets.socket.-ctor?view=netframework-4.7#System_Net_Sockets_Socket__ctor_System_Net_Sockets_AddressFamily_System_Net_Sockets_SocketType_System_Net_Sockets_ProtocolType_)
* Content Source: [xml/System.Net.Sockets/Socket.xml](https://github.com/dotnet/dotnet-api-docs/blob/master/xml/System.Net.Sockets/Socket.xml)
* Product: **dotnet-api**
* GitHub Login: @karelz
* Microsoft Alias: **ncldev**
Guida per i contributori
Apri la guida per i contributori
Direzione di ricerca
Inizia da xml/System.Net.Sockets/Socket.xml e dalla voce collegata relativa al costruttore Socket. Esamina come sono attualmente documentati i parametri del costruttore, quindi aggiungi una descrizione chiara delle combinazioni valide di SocketType e ProtocolType; il lavoro è completato quando i lettori possono identificare le combinazioni supportate senza procedere per tentativi.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- csharp
- Ambito
- documentation, networking
- Tipo di issue
- Documentazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Stato di attività
- Ferma
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 38/100