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_in (Structures)
.
Summary
TODO - a short description
C# Definition:
[StructLayout(LayoutKind.Explicit, Size = 28)]
internal struct sockaddr_in6
{
[FieldOffset(0)] internal ADDRESS_FAMILIES sin6_family;
[FieldOffset(2)] internal ushort sin6_port;
[FieldOffset(4)] internal uint sin6_flowinfo;
[FieldOffset(8)] internal in6_addr sin6_addr;
[FieldOffset(24)] internal uint sin6_scope_id;
internal string Host
{
get
{
var local = this;
var length = (uint) 256;
var builder = new StringBuilder((int) length);
var data = new WSAData();
WSAStartup(2, ref data);
WSAAddressToString(ref local, (uint) Marshal.SizeOf(local), IntPtr.Zero, builder,
ref length);
WSACleanup();
return builder.ToString().Split(':')[0];
}
}
internal string Port
{
get
{
var local = this;
var length = (uint) 256;
var builder = new StringBuilder((int) length);
var data = new WSAData();
WSAStartup(2, ref data);
WSAAddressToString(ref local, (uint) Marshal.SizeOf(local), IntPtr.Zero, builder,
ref length);
WSACleanup();
return builder.ToString().Split(':')[1];
}
}
internal static sockaddr_in6 FromString(string host, int port)
{
var sockaddr = new sockaddr_in6();
var lpAddressLength = Marshal.SizeOf(sockaddr);
WSAStringToAddress(host + ":" + port, EnumLib.ADDRESS_FAMILIES.AF_INET6, IntPtr.Zero,
ref sockaddr, ref lpAddressLength);
return sockaddr;
}
}
[StructLayout(LayoutKind.Explicit, Size = 28)]
internal struct sockaddr_in6_UNSAFE
{
[FieldOffset(0)] internal EnumLib.ADDRESS_FAMILIES sin6_family;
[FieldOffset(2)] internal ushort sin6_port;
[FieldOffset(4)] internal uint sin6_flowinfo;
[FieldOffset(8)] internal in6_addr sin6_addr;
[FieldOffset(24)] internal uint sin6_scope_id;
internal string Host
{
get
{
var local = this;
var length = (uint) 256;
var builder = new StringBuilder((int) length);
var data = new WSAData();
WSAStartup(2, ref data);
WSAAddressToString(ref local, (uint) Marshal.SizeOf(local), IntPtr.Zero, builder,
ref length);
WSACleanup();
return builder.ToString().Split(':')[0];
}
}
internal string Port
{
get
{
var local = this;
var length = (uint) 256;
var builder = new StringBuilder((int) length);
var data = new WSAData();
WSAStartup(2, ref data);
WSAAddressToString(ref local, (uint) Marshal.SizeOf(local), IntPtr.Zero, builder,
ref length);
WSACleanup();
return builder.ToString().Split(':')[1];
}
}
internal static sockaddr_in6 FromString(string host, int port)
{
var sockaddr = new sockaddr_in6();
var lpAddressLength = Marshal.SizeOf(sockaddr);
WSAStringToAddress(host + ":" + port, EnumLib.ADDRESS_FAMILIES.AF_INET6, IntPtr.Zero,
ref sockaddr, ref lpAddressLength);
return sockaddr;
}
}
VB Definition:
Structure sockaddr_in6
Public TODO
End Structure
User-Defined Field Types:
ADDRESS_FAMILIES
Notes:
None.
Documentation
TODO - a short description
4/11/2012 8:53:27 AM - -77.125.97.109
Please edit this page!
Do you have...
helpful tips?
corrections to the existing content?
alternate definitions?
additional languages you want to include?
Select "Edit This Page" on the right hand toolbar and edit it! Or add new pages containing any supporting types needed.