|
.NET Framework | |||||||||
PREV TYPE NEXT TYPE | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONST | PROP | METHOD | OP | EVENT | DETAIL: FIELD | CONST | PROP | METHOD | OP | EVENT |
Adds random port binding functionality to the usual ServerManagerAsync class
Field Summary | |
---|---|
int |
BIND_ATTEMPT_MAX
How many attempts should be made to bind to a port |
int |
BIND_RANDOM_MAX
Random number bound to be added to base port |
Fields inherited from class ClintHeyer.Httpd.ServerManagerAsync |
---|
address, connections, port, socket |
Fields inherited from class ClintHeyer.Httpd.ServerManager |
---|
url |
Fields inherited from class ClintHeyer.Httpd.Context |
---|
configuration, contexts, padlock, parent, requiresSession, sessionManager, throttleRate |
Constructor Summary | |
---|---|
NaanouServerManager(string address, int basePort) Constructor |
Property Summary | |
---|---|
int |
Port
Gets port server is running on |
Properties inherited from class ClintHeyer.Httpd.ServerManagerAsync |
---|
Address, Connections |
Properties inherited from class ClintHeyer.Httpd.ServerManager |
---|
TicketIssuer, Url |
Properties inherited from class ClintHeyer.Httpd.Context |
---|
Lock, Parent, RequiresSession, ServerManager, SessionManager, ThrottleRate |
Method Summary | |
---|---|
void |
BindSocket(int port) Binds the server to a port. If it cannot bind it picks a random port between port and BIND_RANDOM_MAX. |
Methods inherited from class ClintHeyer.Httpd.ServerManagerAsync |
---|
AllowConnection, Close, ConnectionClosed, GCConnections, OnConnectRequest |
Methods inherited from class ClintHeyer.Httpd.ServerManager |
---|
Finalize, GetMimeType, HandleRequest, LoadConfig, SaveConfig |
Methods inherited from class ClintHeyer.Httpd.Context |
---|
AddContext, AddResponseHandler, CanHandleRequest, GetContexts, GetResponseHandler, Handle, IConfigurable.Get, IConfigurable.GetBool, IConfigurable.GetFloat, IConfigurable.GetInt, IConfigurable.GetString, OnReplyCompleted, OnReplyCompletedEvent, OnReplyStarted, OnReplyStartedEvent, OnThrottleChange, OnThrottleChangeEvent, RemoveContext |
Methods inherited from class System.Object |
---|
Equals, GetHashCode, GetType, MemberwiseClone, ToString |
Events inherited from class ClintHeyer.Httpd.Context |
---|
ReplyCompleted, ReplyStarted, ThrottleChange |
Field Detail |
---|
public int BIND_ATTEMPT_MAX
How many attempts should be made to bind to a port
public int BIND_RANDOM_MAX
Random number bound to be added to base port
Constructor Detail |
---|
public NaanouServerManager(string address, int basePort)
Constructor
Parameters:
address
- IP address or hostname to advertise as the server addressbasePort
- Base port, or -1 for a random portProperty Detail |
---|
public int Port
Gets port server is running on
Method Detail |
---|
protected void BindSocket(int port)
Binds the server to a port. If it cannot bind it picks a random port between port and BIND_RANDOM_MAX.
Parameters:
port
- Port number, or -1 for a random portSystem.Net.Sockets.SocketException
- If random port binding fails after BIND_ATTEMPT_MAX attempts.
|
.NET Framework | |||||||||
PREV TYPE NEXT TYPE | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONST | PROP | METHOD | OP | EVENT | DETAIL: FIELD | CONST | PROP | METHOD | OP | EVENT |