Search
Module:
Directory

   Desktop Functions:

   Smart Device Functions:


Show Recent Changes
Subscribe (RSS)
Misc. Pages
Comments
FAQ
Helpful Tools
Playground
Suggested Reading
Website TODO List
Support Forum
Download Visual Studio Add-In

Terms of Use
Privacy Policy

Search Results for "SOCKADDR" in [All]

netapi32

.

    SockAddr sockAddr = new SockAddr();

.

    IntPtr pSockAddr = IntPtr.Zero;

.

        int sockAddrSize = Marshal.SizeOf(sockAddr);

.

            ref sockAddr,

.

            ref sockAddrSize);

.

        // Allocate memory on the heap for the SockAddr structure

.

        pSockAddr = Marshal.AllocHGlobal(Marshal.SizeOf(sockAddr));

.

        Marshal.StructureToPtr(sockAddr, pSockAddr, true);

.

        SocketAddresses[0].lpSockaddr = pSockAddr;

.

        SocketAddresses[0].iSockaddrLength = Marshal.SizeOf(sockAddr);

.

     IntPtr SockAddressCount,

.

     IntPtr SockAddresses, //must free this if using (SocketAddressCount > 1)

.

    [In, Out] ref IntPtr sockAddressCount,

.

SockAddressCount

.

[out, optional] Pointer to a ULONG value that receives the number of elements in the SockAddresses array. If this parameter is NULL, socket addresses are not retrieved.

.

SockAddresses

.

[out, optional] Pointer to an array of SOCKET_ADDRESS structures that receives the socket address data for the domain controller. SockAddressCount receives the number of elements in this array.

.

This parameter is ignored if SockAddressCount is NULL.

httpapi

.

        //which is what the SOCKADDR accepts

Structures

.

        internal sockaddr_UNSAFE* ai_addr;

.

                hostList.Add(info.SockaddrIn6.Host);

.

        internal sockaddr_in SockaddrIn

.

            return (sockaddr_in) Marshal.PtrToStructure(

.

            typeof (sockaddr_in));

.

        internal sockaddr_in6 SockaddrIn6

.

            return (sockaddr_in6) Marshal.PtrToStructure(

.

            typeof (sockaddr_in6));

.

sockaddr

.

sockaddr_in

.

sockaddr_in6

.

    internal struct sockaddr_in6_old

.

Structure sockaddr_in6_old

.
Documentation
[sockaddr_in6_old] on MSDN
.

    internal struct sockaddr_gen

.

        //internal sockaddr Address;

.

        //internal sockaddr_in AddressIn;

.

        [FieldOffset(0)] internal sockaddr_in6_old AddressIn6;

.

Structure sockaddr_gen

.

sockaddr_in6_old

.
Documentation
[sockaddr_gen] on MSDN
.

    internal struct sockaddr_in6

.

        internal static sockaddr_in6 FromString(string host, int port)

.

        var sockaddr = new sockaddr_in6();

.

        var lpAddressLength = Marshal.SizeOf(sockaddr);

.

                          ref sockaddr, ref lpAddressLength);

.

        return sockaddr;

.

    internal struct sockaddr_in6_UNSAFE

.

        internal static sockaddr_in6 FromString(string host, int port)

.

        var sockaddr = new sockaddr_in6();

.

        var lpAddressLength = Marshal.SizeOf(sockaddr);

.

                          ref sockaddr, ref lpAddressLength);

.

        return sockaddr;

.

Structure sockaddr_in6

.
Documentation
[sockaddr_in6] on MSDN
.

    internal struct sockaddr_in6

.

        internal static sockaddr_in6 FromString(string host, int port)

.

        var sockaddr = new sockaddr_in6();

.

        var lpAddressLength = Marshal.SizeOf(sockaddr);

.

                          ref sockaddr, ref lpAddressLength);

.

        return sockaddr;

.

    internal struct sockaddr_in6_UNSAFE

.

        internal static sockaddr_in6 FromString(string host, int port)

.

        var sockaddr = new sockaddr_in6();

.

        var lpAddressLength = Marshal.SizeOf(sockaddr);

.

                          ref sockaddr, ref lpAddressLength);

.

        return sockaddr;

.

Structure sockaddr_in6

.
Documentation
[sockaddr_in6] on MSDN
.

        public IntPtr lpSockaddr;

.

        public int iSockaddrLength;

dnsapi

.

    private const int DnsAddrMaxSockaddrLength = 32;

.

            SockAddrIn sockAddrIn = new SockAddrIn();

.

            Buffer.BlockCopy(ipv4AddressBytes, 0, sockAddrIn.SinAddr, 0, IpAddressV4LengthBytes);

.

            sockAddrIn.SinFamily = AFInet;

.

            sockAddrIn.SinPort = (ushort)IPAddress.HostToNetworkOrder(DNSPort);

.

            IntPtr sockAddrInPtr = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(SockAddrIn)));

.

            Marshal.StructureToPtr(sockAddrIn, sockAddrInPtr, false);

.

            Marshal.Copy(sockAddrInPtr, addrList[curAddress].MaxSa, 0, Marshal.SizeOf(typeof(SockAddrIn)));

.

            Marshal.FreeHGlobal(sockAddrInPtr);

.

            SockAddrIn6 sockAddrIn6 = new SockAddrIn6();

.

            sockAddrIn6.Sin6Family = AFInet16;

.

            sockAddrIn6.Sin6Port = (ushort)IPAddress.HostToNetworkOrder(DNSPort);

.

            sockAddrIn6.Sin6FlowInfo = 0;

.

            Buffer.BlockCopy(ipv6AddressBytes, 0, sockAddrIn6.Sin6Addr, 0, IpAddressV6LengthBytes);

.

            sockAddrIn6.Sin6ScopeId = 0;

.

            IntPtr sockAddrv6InPtr = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(SockAddrIn6)));

.

            Marshal.StructureToPtr(sockAddrIn6, sockAddrv6InPtr, false);

.

            Marshal.Copy(sockAddrv6InPtr, addrList[curAddress].MaxSa, 0, Marshal.SizeOf(typeof(SockAddrIn6)));

.

            Marshal.FreeHGlobal(sockAddrv6InPtr);

.

        [MarshalAs(UnmanagedType.ByValArray, SizeConst = DnsAddrMaxSockaddrLength)]

.

        this.maxSa = new byte[DnsAddrMaxSockaddrLength];

.

    private class SockAddrIn

.

        public SockAddrIn()

.

    private class SockAddrIn6

.

        public SockAddrIn6()

ws2_32

12: accept
.

        ByRef socketAddress As sockaddr, _

13: bind
.
Parameter
socketAddress A sockaddr_in structure used to identify the IP address and port to bind to.
.

    public static extern int bind(IntPtr s, ref sockaddr_in addr, int addrsize);

.

    public static extern int bind(IntPtr s, ref sockaddr_in6 addr, int addrsize);

.

        ByRef socketAddress As sockaddr_in, _

.

    sockaddr_in remoteAddress;            //Remote address structure.

.

            remoteAddress = new sockaddr_in();

.

    public static extern int connect(IntPtr s, ref sockaddr_in addr, int addrsize);

.

    public static extern int connect(IntPtr s, ref sockaddr_in6 addr, int addrsize);

.

        public sockaddr_gen iiAddress;

.

        public sockaddr_gen iiBroadcastAddress;

.

        public sockaddr_gen iiNetmask;

.

sockaddr_gen

16: recv
.

    public static extern int recvfrom(IntPtr Socket, IntPtr buf, int len, SendDataFlags flags, ref SockAddr from, IntPtr fromlen);

.

    public static int recvfrom(IntPtr Socket, IntPtr buf, int len, SendDataFlags flags, ref SockAddr from)

17: send
.

public static extern int SendTo (IntPtr Socket, IntPtr buff, int len, SendDataFlags flags, ref SockAddr To, int tomlen);

.

    public struct SockAddr

.

    public SockAddr (short Family, ushort Port, AddressIP4 IP)

18: SendTo
.

public static extern int SendTo (IntPtr Socket, IntPtr buff, int len, SendDataFlags flags, ref SockAddr To, int tomlen);

.

    public struct SockAddr

.

    public SockAddr (short Family, ushort Port, AddressIP4 IP)

.

converts all components of a sockaddr structure into a human-readable string representation of the address.

.

    public static extern uint WSAAddressToString(ref sockaddr_in lpsaAddress, int dwAddressLength, IntPtr lpProtocolInfo,

.

    public static extern uint WSAAddressToString(ref  sockaddr_in6 lpsaAddress, int dwAddressLength, IntPtr lpProtocolInfo,

.

    public int iMaxSockAddr;

.

    public int iMinSockAddr;

.
Summary
The WSAStringToAddress function converts a network address in its standard text presentation form into its numeric binary form in a sockaddr structure, suitable for passing to Windows Sockets routines that take such a structure.
.

    /* converts a network address in its standard text presentation form into its numeric binary form in a sockaddr structure.  */

.

                      ref sockaddr_in6    pAddr,

.
  • socketAddress: A pointer to a buffer that is filled with a sockaddr structure for the address string if the function succeeds.
.

    SockAddr sockAddr = new SockAddr();

.

    IntPtr pSockAddr = IntPtr.Zero;

.

        int sockAddrSize = Marshal.SizeOf(sockAddr);

.

        ref sockAddr,

.

        ref sockAddrSize);

.

    pSockAddr = Marshal.AllocHGlobal(Marshal.SizeOf(sockAddr));

.

    Marshal.StructureToPtr(sockAddr, pSockAddr, true);

iphlpapi

.

    public struct SOCKADDR

.

        public IntPtr lpSockAddr;

.

        public int iSockaddrLength;

.

            if (IntPtr.Zero != unicastAddr.Address.lpSockAddr)

.

            SOCKADDR socketAddr = (SOCKADDR)Marshal.PtrToStructure(unicastAddr.Address.lpSockAddr, typeof(SOCKADDR));


 
Access PInvoke.net directly from VS: