removed some duplicate hard-coded port numbers. changed ports to uint.

afrisby
Jeff Ames 2007-12-06 01:41:41 +00:00
parent d2736437d4
commit 4bde56457f
19 changed files with 43 additions and 47 deletions

View File

@ -50,7 +50,7 @@ namespace OpenSim.Region.Capabilities
public class Caps
{
private string m_httpListenerHostName;
private int m_httpListenPort;
private uint m_httpListenPort;
private string m_capsObjectPath = "00001-";
private string m_requestPath = "0000/";
private string m_mapLayerPath = "0001/";
@ -68,7 +68,7 @@ namespace OpenSim.Region.Capabilities
public NewInventoryItem AddNewInventoryItem = null;
public ItemUpdatedCallback ItemUpdatedCall = null;
public Caps(AssetCache assetCache, BaseHttpServer httpServer, string httpListen, int httpPort, string capsPath,
public Caps(AssetCache assetCache, BaseHttpServer httpServer, string httpListen, uint httpPort, string capsPath,
LLUUID agent, bool dumpAssetsToFile)
{
m_assetCache = assetCache;

View File

@ -70,7 +70,7 @@ namespace OpenSim.Framework.UserManagement
private string gendered;
private string everLoggedIn;
private string login;
private int simPort;
private uint simPort;
private string simAddress;
private string agentAccess;
private Int32 circuitCode;
@ -369,7 +369,7 @@ namespace OpenSim.Framework.UserManagement
set { everLoggedIn = value; }
} // EverLoggedIn
public int SimPort
public uint SimPort
{
get { return simPort; }
set { simPort = value; }

View File

@ -345,15 +345,15 @@ namespace OpenSim.Framework.Console
return address;
}
public int CmdPromptIPPort(string prompt, string defaultvalue)
public uint CmdPromptIPPort(string prompt, string defaultvalue)
{
int port;
uint port;
string portStr;
while (true)
{
portStr = MainLog.Instance.CmdPrompt(prompt, defaultvalue);
if (int.TryParse(portStr, out port))
if (uint.TryParse(portStr, out port))
{
if (port >= IPEndPoint.MinPort && port <= IPEndPoint.MaxPort)
{

View File

@ -13,7 +13,7 @@ namespace OpenSim.Framework
public string DatabaseProvider = "";
public static uint DefaultHttpPort = 8004;
public int HttpPort = 8004;
public uint HttpPort = DefaultHttpPort;
private ConfigurationMember configMember;
@ -63,7 +63,7 @@ namespace OpenSim.Framework
DatabaseProvider = (string) configuration_result;
break;
case "http_port":
HttpPort = (int) configuration_result;
HttpPort = (uint) configuration_result;
break;
}

View File

@ -45,10 +45,10 @@ namespace OpenSim.Framework
public string InventoryURL = "";
public static int DefaultHttpListenerPort = 9000;
public int HttpListenerPort = DefaultHttpListenerPort;
public static uint DefaultHttpListenerPort = 9000;
public uint HttpListenerPort = DefaultHttpListenerPort;
public static int RemotingListenerPort = 8895;
public static uint RemotingListenerPort = 8895;
public NetworkServersInfo()
@ -80,8 +80,8 @@ namespace OpenSim.Framework
m_defaultHomeLocX = (uint) config.Configs["StandAlone"].GetInt("default_location_x", 1000);
m_defaultHomeLocY = (uint) config.Configs["StandAlone"].GetInt("default_location_y", 1000);
HttpListenerPort = config.Configs["Network"].GetInt("http_listener_port", DefaultHttpListenerPort);
RemotingListenerPort = config.Configs["Network"].GetInt("remoting_listener_port", RemotingListenerPort);
HttpListenerPort = (uint) config.Configs["Network"].GetInt("http_listener_port", (int) DefaultHttpListenerPort);
RemotingListenerPort = (uint) config.Configs["Network"].GetInt("remoting_listener_port", (int) RemotingListenerPort);
GridURL =
config.Configs["Network"].GetString("grid_server_url",
"http://127.0.0.1:" + GridConfig.DefaultHttpPort.ToString());

View File

@ -56,15 +56,14 @@ namespace OpenSim.Framework
m_externalHostName = externalUri;
}
public SimpleRegionInfo(uint regionLocX, uint regionLocY, string externalUri, int port)
public SimpleRegionInfo(uint regionLocX, uint regionLocY, string externalUri, uint port)
{
m_regionLocX = regionLocX;
m_regionLocY = regionLocY;
m_externalHostName = externalUri;
m_internalEndPoint = new IPEndPoint(IPAddress.Parse("0.0.0.0"), port);
m_internalEndPoint = new IPEndPoint(IPAddress.Parse("0.0.0.0"), (int) port);
}
public LLUUID RegionID = LLUUID.Zero;
@ -270,7 +269,7 @@ namespace OpenSim.Framework
{
errorMessage = "needs an IP Address (IPAddress)";
}
this.m_internalEndPoint.Port = source.Configs[sectionName].GetInt("internal_ip_port", NetworkServersInfo.DefaultHttpListenerPort);
this.m_internalEndPoint.Port = source.Configs[sectionName].GetInt("internal_ip_port", (int) NetworkServersInfo.DefaultHttpListenerPort);
string externalHost = source.Configs[sectionName].GetString("external_host_name", "127.0.0.1");
if (externalHost != "SYSTEMIP")

View File

@ -51,7 +51,6 @@ namespace OpenSim.Framework
m_externalHostName = ConvertFrom.ExternalHostName;
m_remotingPort = ConvertFrom.RemotingPort;
RemotingAddress = ConvertFrom.RemotingAddress;
}
public SearializableRegionInfo(uint regionLocX, uint regionLocY, IPEndPoint internalEndPoint, string externalUri)
{
@ -63,15 +62,14 @@ namespace OpenSim.Framework
m_externalHostName = externalUri;
}
public SearializableRegionInfo(uint regionLocX, uint regionLocY, string externalUri, int port)
public SearializableRegionInfo(uint regionLocX, uint regionLocY, string externalUri, uint port)
{
m_regionLocX = regionLocX;
m_regionLocY = regionLocY;
m_externalHostName = externalUri;
m_internalEndPoint = new IPEndPoint(IPAddress.Parse("0.0.0.0"), port);
m_internalEndPoint = new IPEndPoint(IPAddress.Parse("0.0.0.0"), (int) port);
}
public LLUUID RegionID = LLUUID.Zero;

View File

@ -44,21 +44,21 @@ namespace OpenSim.Framework.Servers
protected HttpListener m_httpListener;
protected Dictionary<string, XmlRpcMethod> m_rpcHandlers = new Dictionary<string, XmlRpcMethod>();
protected Dictionary<string, IRequestHandler> m_streamHandlers = new Dictionary<string, IRequestHandler>();
protected int m_port;
protected uint m_port;
protected bool m_ssl = false;
protected bool m_firstcaps = true;
public int Port
public uint Port
{
get { return m_port; }
}
public BaseHttpServer(int port)
public BaseHttpServer(uint port)
{
m_port = port;
}
public BaseHttpServer(int port, bool ssl)
public BaseHttpServer(uint port, bool ssl)
{
m_ssl = ssl;
m_port = port;

View File

@ -76,7 +76,7 @@ namespace OpenSim.Framework
configMember.addConfigurationOption("default_inventory_server",
ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY,
"Default Inventory Server URI",
"http://127.0.0.1:8004/", false);
"http://127.0.0.1:" + InventoryConfig.DefaultHttpPort.ToString() + "/", false);
configMember.addConfigurationOption("database_provider", ConfigurationOption.ConfigurationTypes.TYPE_STRING,
"DLL for database provider", "OpenSim.Framework.Data.MySQL.dll", false);

View File

@ -92,7 +92,7 @@ namespace OpenSim.Grid.AssetServer
LoadDefaultAssets();
m_console.Verbose("ASSET", "Starting HTTP process");
BaseHttpServer httpServer = new BaseHttpServer((int) m_config.HttpPort);
BaseHttpServer httpServer = new BaseHttpServer(m_config.HttpPort);
httpServer.AddStreamHandler(new GetAssetStreamHandler(this, m_assetProvider));
httpServer.AddStreamHandler(new PostAssetStreamHandler(this, m_assetProvider));

View File

@ -112,7 +112,7 @@ namespace OpenSim.Grid.GridServer
m_gridManager.config = Cfg;
m_console.Verbose("GRID", "Starting HTTP process");
BaseHttpServer httpServer = new BaseHttpServer((int) Cfg.HttpPort);
BaseHttpServer httpServer = new BaseHttpServer(Cfg.HttpPort);
//GridManagementAgent GridManagerAgent = new GridManagementAgent(httpServer, "gridserver", Cfg.SimSendKey, Cfg.SimRecvKey, managercallback);
httpServer.AddXmlRPCHandler("simulator_login", m_gridManager.XmlRpcSimulatorLoginMethod);

View File

@ -92,7 +92,7 @@ namespace OpenSim.Grid.UserServer
m_loginService = new UserLoginService(m_userManager, Cfg, Cfg.DefaultStartupMsg);
MainLog.Instance.Verbose("REGION", "Starting HTTP process");
BaseHttpServer httpServer = new BaseHttpServer((int) Cfg.HttpPort);
BaseHttpServer httpServer = new BaseHttpServer(Cfg.HttpPort);
httpServer.AddXmlRPCHandler("login_to_simulator", m_loginService.XmlRpcLoginMethod);

View File

@ -81,7 +81,7 @@ namespace OpenSim.Grid.UserServer
MainLog.Instance.Verbose("LOGIN", "CUSTOMISERESPONSE: Region X: " + SimInfo.regionLocX + "; Region Y: " +
SimInfo.regionLocY);
response.SimAddress = Util.GetHostFromDNS(SimInfo.serverIP).ToString();
response.SimPort = (Int32)SimInfo.serverPort;
response.SimPort = (uint) SimInfo.serverPort;
response.RegionX = SimInfo.regionLocX;
response.RegionY = SimInfo.regionLocY;
@ -149,7 +149,7 @@ namespace OpenSim.Grid.UserServer
MainLog.Instance.Verbose("LOGIN", "CUSTOMISERESPONSE: Region X: " + SimInfo.regionLocX + "; Region Y: " +
SimInfo.regionLocY);
response.SimAddress = Util.GetHostFromDNS(SimInfo.serverIP).ToString();
response.SimPort = (Int32)SimInfo.serverPort;
response.SimPort = (uint) SimInfo.serverPort;
response.RegionX = SimInfo.regionLocX;
response.RegionY = SimInfo.regionLocY;

View File

@ -49,7 +49,7 @@ namespace OpenSim.Region.ClientStack
protected NetworkServersInfo m_networkServersInfo;
protected BaseHttpServer m_httpServer;
protected int m_httpServerPort;
protected uint m_httpServerPort;
protected LogBase m_log;
protected CommunicationsManager m_commsManager;
@ -106,7 +106,7 @@ namespace OpenSim.Region.ClientStack
protected Scene SetupScene(RegionInfo regionInfo, out UDPServer udpServer, bool m_permissions)
{
AgentCircuitManager circuitManager = new AgentCircuitManager();
udpServer = new UDPServer(regionInfo.InternalEndPoint.Port, m_assetCache, m_log, circuitManager);
udpServer = new UDPServer((uint) regionInfo.InternalEndPoint.Port, m_assetCache, m_log, circuitManager);
Scene scene = CreateScene(regionInfo, m_storageManager, circuitManager);

View File

@ -49,7 +49,7 @@ namespace OpenSim.Region.ClientStack
protected PacketServer m_packetServer;
protected ulong m_regionHandle;
protected int listenPort;
protected uint listenPort;
protected IScene m_localScene;
protected AssetCache m_assetCache;
protected LogBase m_log;
@ -83,7 +83,7 @@ namespace OpenSim.Region.ClientStack
{
}
public UDPServer(int port, AssetCache assetCache, LogBase console, AgentCircuitManager authenticateClass)
public UDPServer(uint port, AssetCache assetCache, LogBase console, AgentCircuitManager authenticateClass)
{
listenPort = port;
m_assetCache = assetCache;
@ -180,9 +180,9 @@ namespace OpenSim.Region.ClientStack
public void ServerListener()
{
m_log.Verbose("SERVER", "Opening UDP socket on " + listenPort);
m_log.Verbose("SERVER", "Opening UDP socket on " + listenPort.ToString());
ServerIncoming = new IPEndPoint(IPAddress.Parse("0.0.0.0"), listenPort);
ServerIncoming = new IPEndPoint(IPAddress.Parse("0.0.0.0"), (int) listenPort);
Server = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp);
Server.Bind(ServerIncoming);

View File

@ -121,11 +121,10 @@ namespace OpenSim.Region.Communications.Local
theUser.homeLocation.Y.ToString() + ",r" + theUser.homeLocation.Z.ToString() + "]}";
string capsPath = Util.GetRandomCapsPath();
response.SimAddress = reg.ExternalEndPoint.Address.ToString();
response.SimPort = (Int32) reg.ExternalEndPoint.Port;
response.SimPort = (uint) reg.ExternalEndPoint.Port;
response.RegionX = reg.RegionLocX;
response.RegionY = reg.RegionLocY;
response.SeedCapability = "http://" + reg.ExternalHostName + ":" +
serversInfo.HttpListenerPort.ToString() + "/CAPS/" + capsPath + "0000/";
// response.SeedCapability = "http://" + reg.ExternalHostName + ":" + this.serversInfo.HttpListenerPort.ToString() + "/CapsSeed/" + capsPath + "0000/";

View File

@ -166,7 +166,7 @@ namespace OpenSim.Region.Communications.OGS1
{
string simIp = (string) neighbourData["sim_ip"];
int port = Convert.ToInt32(neighbourData["sim_port"]);
uint port = Convert.ToUInt32(neighbourData["sim_port"]);
string externalUri = (string) neighbourData["sim_uri"];
string externalIpStr = Util.GetHostFromDNS(simIp).ToString();
@ -450,7 +450,7 @@ namespace OpenSim.Region.Communications.OGS1
/// </summary>
private void StartRemoting()
{
TcpChannel ch = new TcpChannel(NetworkServersInfo.RemotingListenerPort);
TcpChannel ch = new TcpChannel((int) NetworkServersInfo.RemotingListenerPort);
ChannelServices.RegisterChannel(ch, false); // Disabled security as Mono doesnt support this.
WellKnownServiceTypeEntry wellType =
@ -559,7 +559,7 @@ namespace OpenSim.Region.Communications.OGS1
// it's own remoting port! How special.
region = new SearializableRegionInfo(RequestNeighbourInfo(region.RegionHandle));
region.RemotingAddress = region.ExternalHostName;
region.RemotingPort = (uint) NetworkServersInfo.RemotingListenerPort;
region.RemotingPort = NetworkServersInfo.RemotingListenerPort;
if (m_localBackend.RegionUp(region,regionhandle))
{
return true;

View File

@ -265,7 +265,7 @@ namespace OpenSim.Region.Environment.Modules
internal class IRCChatModule
{
private string m_server = null;
private int m_port = 6668;
private uint m_port = 6668;
private string m_user = "USER OpenSimBot 8 * :I'm a OpenSim to irc bot";
private string m_nick = null;
private string m_channel = null;
@ -296,7 +296,7 @@ namespace OpenSim.Region.Environment.Modules
m_server = config.Configs["IRC"].GetString("server");
m_nick = config.Configs["IRC"].GetString("nick");
m_channel = config.Configs["IRC"].GetString("channel");
m_port = config.Configs["IRC"].GetInt("port", m_port);
m_port = (uint) config.Configs["IRC"].GetInt("port", (int) m_port);
m_user = config.Configs["IRC"].GetString("username", m_user);
if (m_server != null && m_nick != null && m_channel != null)
{
@ -316,7 +316,7 @@ namespace OpenSim.Region.Environment.Modules
{
m_scenes = scenes;
m_tcp = new TcpClient(m_server, m_port);
m_tcp = new TcpClient(m_server, (int) m_port);
m_log.Verbose("IRC", "Connecting...");
m_stream = m_tcp.GetStream();
m_log.Verbose("IRC", "Connected to " + m_server);

View File

@ -90,7 +90,7 @@ namespace SimpleApp
m_log.Notice(m_log.LineInfo);
IPEndPoint internalEndPoint =
new IPEndPoint(IPAddress.Parse("127.0.0.1"), m_networkServersInfo.HttpListenerPort);
new IPEndPoint(IPAddress.Parse("127.0.0.1"), (int) m_networkServersInfo.HttpListenerPort);
RegionInfo regionInfo = new RegionInfo(1000, 1000, internalEndPoint, "localhost");
regionInfo.DataStore = "simpleapp_datastore.yap";