Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //C++ Source
- WINSOCK_API_LINKAGE
- int
- WSAAPI
- getpeername(
- __in SOCKET s,
- __out_bcount_part(*namelen,*namelen) struct sockaddr FAR * name,
- __inout int FAR * namelen
- )
- //C# Translation
- /// <summary>
- /// The getpeername function retrieves the address of the peer to which a socket is connected.
- /// </summary>
- /// <param name="s">A descriptor identifying a connected socket.</param>
- /// <param name="name">The SOCKADDR structure that receives the address of the peer.</param>
- /// <param name="namelen">A pointer to the size, in bytes, of the name parameter.</param>
- /// <returns>If no error occurs, getpeername returns zero. Otherwise, a value of SOCKET_ERROR is returned, and a specific error code can be retrieved by calling WSAGetLastError.</returns>
- /// <remarks>http://msdn.microsoft.com/en-us/library/windows/desktop/ms738533%28v=VS.85%29.aspx</remarks>
- [System.Runtime.InteropServices.DllImportAttribute("ws2_32.dll", EntryPoint="getpeername", CallingConvention=System.Runtime.InteropServices.CallingConvention.StdCall)]
- public static extern int getpeername([System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.SysUInt)] uint s, System.IntPtr name, ref int namelen) ;
- //C# error
- Error 1 "Expected Class, Delegate, Enum, Interface or Struct."
Advertisement
Add Comment
Please, Sign In to add comment