The bind function is used on an unconnected socket before subsequent calls to the connect or listen functions. It is not neccessary to use bind for connect(), but is required for listen(). This binding process is performed by the connect() function implicitly.
.
public static extern int listen(IntPtr s, int backlog);
.
Declare Function listen Lib "ws2_32.dll" (TODO) As TODO
.
.
/// socket has had listen()
.
// socket has had listen()
.
WTSListen,
.
WTSListen,
.
WTSListen
.
WTSListen
.
Case WTS_CONNECTSTATE_CLASS.WTSListen
.
RetVal = "Listen"
.
.
public struct HTTP_SERVICE_CONFIG_IP_LISTEN_PARAM
.
Structure HTTP_SERVICE_CONFIG_IP_LISTEN_PARAM
.
.
.
struct HTTP_SERVICE_CONFIG_IP_LISTEN_QUERY
.
Structure HTTP_SERVICE_CONFIG_IP_LISTEN_QUERY
.
.
TCP_TABLE_BASIC_LISTENER,
.
TCP_TABLE_OWNER_PID_LISTENER,
.
TCP_TABLE_OWNER_MODULE_LISTENER,
.
TCP_TABLE_BASIC_LISTENER
.
TCP_TABLE_OWNER_PID_LISTENER
.
TCP_TABLE_OWNER_MODULE_LISTENER
.
TCP_TABLE_CLASS = (TCP_TABLE_BASIC_LISTENER,TCP_TABLE_BASIC_CONNECTIONS,
.
TCP_TABLE_BASIC_ALL,TCP_TABLE_OWNER_PID_LISTENER,
.
TCP_TABLE_OWNER_MODULE_LISTENER,TCP_TABLE_OWNER_MODULE_CONNECTIONS,
.
TCP_TABLE_BASIC_LISTENER
.
A MIB_TCPTABLE table that contains all listening (receiving only) TCP endpoints on the machine is returned to the caller.
.
TCP_TABLE_OWNER_PID_LISTENER
.
A MIB_TCPTABLE_OWNER_PID or MIB_TCP6TABLE_OWNER_PID that contains all listening (receiving only) TCP endpoints on the machine is returned to the caller.
.
TCP_TABLE_OWNER_MODULE_LISTENER
.
A MIB_TCPTABLE_OWNER_MODULE or MIB_TCP6TABLE_OWNER_MODULE that contains all listening (receiving only) TCP endpoints on the machine is returned to the caller.
.
/// 2. Call Listen(). This will block until a client connects. Sorry, the alternatives
.
/// 4. Call Listen() again to wait for the next client.
.
/// to support multiple clients, multiple calls to Create()/Listen() in separate threads is the
.
public bool Listen()
.
throw new Exception("Listen() is only for server-side streams");
.
/// Server only: disconnect the pipe. For most applications, you should just call Listen()
.
/// Returns true if client is connected. Should only be called after Listen() succeeds.
.
Console.WriteLine("Listening...");
.
stream.Listen();
.
TextWriterTraceListener ConsoleListener = new TextWriterTraceListener(System.Console.Out);
.
Trace.Listeners.Add(ConsoleListener);
.
HTTP_SERVICE_CONFIG_IP_LISTEN_PARAM
The HTTP_SERVICE_CONFIG_IP_LISTEN_PARAM structure is used to specify an IP address to be added to or deleted from the list of IP addresses to which the HTTP service binds.
3/16/2007 8:16:48 AM - anonymous
.
.
HTTP_SERVICE_CONFIG_IP_LISTEN_QUERY
The HTTP_SERVICE_CONFIG_IP_LISTEN_QUERY structure is used by HttpQueryServiceConfiguration to return a list of the Internet Protocol (IP) addresses to which the HTTP service binds.
3/16/2007 8:16:48 AM - anonymous
.
.
.
HTTP_SERVICE_CONFIG_IP_LISTEN_PARAM
The HTTP_SERVICE_CONFIG_IP_LISTEN_PARAM structure is used to specify an IP address to be added to or deleted from the list of IP addresses to which the HTTP service binds.
3/16/2007 8:16:48 AM - anonymous
.
.
HttpServiceConfigIPListenList = 0,
.
public struct HTTP_SERVICE_CONFIG_IP_LISTEN_PARAM
.
When we are done listening to this playback:
.
When you do not need the PID information look at: IPGlobalProperties.GetActiveTcpListeners Method from the System.Net.NetworkInformation namespace
.
(Msdn: http://msdn.microsoft.com/en-us/library/system.net.networkinformation.ipglobalproperties.getactivetcplisteners.aspx)
.
TCP_TABLE_BASIC_LISTENER,
.
TCP_TABLE_OWNER_PID_LISTENER,
.
TCP_TABLE_OWNER_MODULE_LISTENER,
.
MIB_TCP_STATE_LISTEN,
.
$StateList=@("UNKNOWN","CLOSED","LISTEN","SYN-SENT","SYN-RECEIVED","ESTABLISHED","FIN-WAIT-1","FIN-WAIT-2","CLOSE-WAIT","CLOSING","LAST-ACK","TIME-WAIT","DELETE-TCB")