Type a page name and press Enter. You'll jump to the page if it exists, or you can create it if it doesn't.
To create a page in a module other than Structures, prefix the name with the module name and a period.
SockAddr (Structures)
.
C# Definition:
// WinsockSockAddr takes an IPAddress of IPEndpoint on creation, then provides a
// pinned PSOCKADDR to be used for async PInvoke calls. The owner and pending
// async calls may reference the same instance at the same time, and have
// different independent needs with regards to the lifetime of the pinned
// PSOCKADDR. So WinsockSockAddr guarantees the pinned copy is available so
// long as the WinsockSockAddr instance owning that pinned copy is referenced.
// NOTENOTE: System.Net.Endpoint.Serialize will provide a System.Net.SocketAddress
// which mostly fulfills the same use as the class below. It does not pin the
// result though. Consider passing the result of System.Net.Endpoint.Serialize()
// as X to GCHandle.Alloc(X, GCHandleType.Pinned) instead of picking up the
// entire class below.
[StructLayout(LayoutKind.Sequential)]
struct SOCKADDR_IN
{
public Int16 _family;
public Int16 _port;
public Byte _addr0;
public Byte _addr1;
public Byte _addr2;
public Byte _addr3;
public Int32 _nothing;
}
static readonly int SIZEOF_SOCKADDR_IN = Marshal.SizeOf(typeof(SOCKADDR_IN));
[StructLayout(LayoutKind.Sequential)]
struct SOCKADDR_IN6
{
public Int16 _family;
public Int16 _port;
public Int32 _flowInfo;
public Byte _addr0;
public Byte _addr1;
public Byte _addr2;
public Byte _addr3;
public Byte _addr4;
public Byte _addr5;
public Byte _addr6;
public Byte _addr7;
public Byte _addr8;
public Byte _addr9;
public Byte _addr10;
public Byte _addr11;
public Byte _addr12;
public Byte _addr13;
public Byte _addr14;
public Byte _addr15;
public Int32 _scopeID;
}
static readonly int SIZEOF_SOCKADDR_IN6 = Marshal.SizeOf(typeof(SOCKADDR_IN6));
// Depending on the family type of address represented, either a SOCKADDR_IN
// or a SOCKADDR_IN6 will be referenced by _addr. We'll pin the same object
// to _pinAddr, and finally keep a IntPtr to the alloc.
object _addr;
GCHandle _pinAddr;
IntPtr _pAddr;
public WinsockSockAddr(IPEndPoint source)
: this(source.Address, (short)source.Port)
{
}
public WinsockSockAddr(IPAddress source)
: this(source, 0)
{
}
public WinsockSockAddr(IPAddress source, short port)
{
_pAddr = (IntPtr)0;