From 789692758b3583087728093e8eb061df63222b14 Mon Sep 17 00:00:00 2001 From: Brad Collins <bsc@housecollins.com> Date: Sat, 13 Jul 2019 19:02:14 -0500 Subject: [PATCH] Corrected (?) F# signature of Receive method MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The `Receive` method's F# signature was incorrect—the remoteEP parameter was missing: ``` xml <MemberSignature Language="F#" Value="member this.Receive : -> byte[]" Usage="udpClient.Receive remoteEP" /> ``` Changed the signature and the usage to the following: ``` xml <MemberSignature Language="F#" Value="member this.Receive : (remoteEP : IPEndPoint ref) -> byte[]" Usage="udpClient.Receive (ref remoteEP)" /> ``` However, I am not quite sure how correct this is. The 'Value' attribute is probably correct, but the 'Usage' attribute is suspect. One would not simply pass in `ref remoteEP` but rather something more like this: ``` fsharp let remoteEndPointRef = ref (IPEndPoint (IPAddress.Any, 0)) let bytes = udpClient.Receive remoteEndPointRef printfn "Received from %A: %A" !remoteEndPointRef bytes ``` Finally, there is no F# example code. I should love to submit an F# version of the C# sample, but it is not at all clear to me how to add it! The C# code sample is apparently an include of some sort: ``` [!code-csharp[Classic UdpClient.PublicMethodsAndPropertiesExample#11](~/samples/snippets/csharp/VS_Snippets_Remoting/Classic UdpClient.PublicMethodsAndPropertiesExample/CS/source.cs#11)] ``` Is there a way to do something similar to include an F# sample? --- xml/System.Net.Sockets/UdpClient.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/xml/System.Net.Sockets/UdpClient.xml b/xml/System.Net.Sockets/UdpClient.xml index 82f7a202160..c45a3d25fe0 100644 --- a/xml/System.Net.Sockets/UdpClient.xml +++ b/xml/System.Net.Sockets/UdpClient.xml @@ -2091,7 +2091,7 @@ <MemberSignature Language="DocId" Value="M:System.Net.Sockets.UdpClient.Receive(System.Net.IPEndPoint@)" /> <MemberSignature Language="VB.NET" Value="Public Function Receive (ByRef remoteEP As IPEndPoint) As Byte()" /> <MemberSignature Language="C++ CLI" Value="public:
 cli::array <System::Byte> ^ Receive(System::Net::IPEndPoint ^ % remoteEP);" /> - <MemberSignature Language="F#" Value="member this.Receive : -> byte[]" Usage="udpClient.Receive remoteEP" /> + <MemberSignature Language="F#" Value="member this.Receive : (remoteEP : IPEndPoint ref) -> byte[]" Usage="udpClient.Receive (ref remoteEP)" /> <MemberType>Method</MemberType> <AssemblyInfo> <AssemblyName>System</AssemblyName> @@ -2702,4 +2702,4 @@ Call IDisposable.Dispose when you are finished using the <xref:System.Net.Socket </Docs> </Member> </Members> -</Type> \ No newline at end of file +</Type>