Desktop Functions: Smart Device Functions:
|
Search Results for "socket" in [All]httpapi
// serialize the endpoint to a SocketAddress and create an array to hold the values. Pin the array.
SocketAddress socketAddress = ipEndPoint.Serialize();
byte[] socketBytes = new byte[socketAddress.Size];
GCHandle handleSocketAddress = GCHandle.Alloc(socketBytes, GCHandleType.Pinned);
// Should copy the first 16 bytes (the SocketAddress has a 32 byte buffer, the size will only be 16,
for (int i = 0; i < socketAddress.Size; ++i)
socketBytes[i] = socketAddress[i];
httpServiceConfigSslKey.pIpPort = handleSocketAddress.AddrOfPinnedObject();
handleSocketAddress.Free(); Constants2: WINERROR
/// An attempt was made to access a socket in a way forbidden by its access permissions.
/// Too many open sockets.
/// A non-blocking socket operation could not be completed immediately.
/// An operation was attempted on a non-blocking socket that already had an operation in progress.
/// An operation was attempted on something that is not a socket.
/// A required address was omitted from an operation on a socket.
/// A message sent on a datagram socket was larger than the internal message buffer or some other network limit, or the buffer used to receive a datagram into was smaller than the datagram itself.
/// A protocol was specified in the socket function call that does not support the semantics of the socket type requested.
/// The support for the specified socket type does not exist in this address family.
/// Only one usage of each socket address (protocol/network address/port) is normally permitted.
/// A socket operation encountered a dead network.
/// A socket operation was attempted to an unreachable network.
/// An operation on a socket could not be performed because the system lacked sufficient buffer space or because a queue was full.
/// A connect request was made on an already connected socket.
/// A request to send or receive data was disallowed because the socket is not connected and (when sending on a datagram socket using a sendto call) no address was supplied.
/// A request to send or receive data was disallowed because the socket had already been shut down in that direction with a previous shutdown call.
/// A socket operation failed because the destination host was down.
/// A socket operation was attempted to an unreachable host.
/// A Windows Sockets implementation may have a limit on the number of applications that may use it simultaneously.
/// The Windows Sockets version requested is not supported. iphlpapi3: AddIPAddress using System.Net.Sockets;
public struct SOCKET_ADDRESS
public SOCKET_ADDRESS Address;
public SOCKET_ADDRESS Dhcpv4Server;
public SOCKET_ADDRESS Dhcpv6Server;
SOCKADDR socketAddr = (SOCKADDR)Marshal.PtrToStructure(unicastAddr.Address.lpSockAddr, typeof(SOCKADDR));
byte[] saData = socketAddr.sa_data.Skip(2).Take(4).ToArray();
catch (SocketException e)
Console.WriteLine("SocketException caught!!!");
public const int AF_INET = 2; // IP_v4 = System.Net.Sockets.AddressFamily.InterNetwork
public const int AF_INET6 = 23; // IP_v6 = System.Net.Sockets.AddressFamily.InterNetworkV6
public const int AF_INET = 2; // IP_v4 = System.Net.Sockets.AddressFamily.InterNetwork
public const int AF_INET6 = 23; // IP_v6 = System.Net.Sockets.AddressFamily.InterNetworkV6 netapi32
public static extern int DsAddressToSiteNames(string computerName, int entryCount, SOCKET_ADDRESS[] socketAddresses, ref IntPtr siteNames);
Prior to calling he DsAddressToSiteNames function, a SOCKET_ADDRESS structure must be created for each address that is to be resolved to a site name. This can be done using the WSAStringToAddress method shown in the sample code.
SOCKET_ADDRESS[] SocketAddresses = new SOCKET_ADDRESS[1];
// Call into WSAStringToAddress to build SOCKET_ADDRESS structure from the address string
System.Net.Sockets.AddressFamily.InterNetwork,
SocketAddresses[0].lpSockaddr = pSockAddr;
SocketAddresses[0].iSockaddrLength = Marshal.SizeOf(sockAddr);
result = DsAddressToSiteNames("domaincontroller.mydomain.com", 1, SocketAddresses, ref pSites); 8: DsGetDcNext
IntPtr SockAddresses, //must free this if using (SocketAddressCount > 1) [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. [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.
using System.Net.Sockets; Structures10: addrinfo
11: AI
/// The socket address will be used in a call to the bind function. 12: fd_set
public static fd_set Create(IntPtr socket)
fd_array = new IntPtr[Size] { socket }
public uint SocketRegistersBaseAddress; 15: SOCKET_ADDRESS
16: WSADATA
17: WSAQUERYSET
secur32
using System.Net.Sockets; ws2_3219: accept
ByVal socketHandle As IntPtr, _
ByRef socketAddress As sockaddr, _
System.Net.Sockets.Socket.Accept() 20: bind
|