Reputation: 7571
I have a problem connecting to a port in asp.net web application.
This is the code that i'm using:
internal static IObjectContainer Client
{
get
{
HttpContext context = HttpContext.Current;
IObjectContainer objectClient = context.Items[KEY_DB4O_CLIENT] as IObjectContainer;
if (objectClient == null)
{
objectClient = Db4oClientServer.OpenClient("localhost", 8372, "duran", "");
context.Items[KEY_DB4O_CLIENT] = objectClient;
}
return objectClient;
}
}
private static IObjectServer Server
{
get
{
HttpContext context = HttpContext.Current;
if (objectServer == null)
{
string yapFilePath = context.Server.MapPath(ConfigurationSettings.AppSettings[KEY_DB4O_FILE_NAME]);
objectServer = Db4oClientServer.OpenServer(yapFilePath, 8372);
objectServer.GrantAccess("duran", "");
}
return objectServer;
}
}
the error i'm getting is :
Server Error in '/' Application. No connection could be made because the target machine actively refused it 127.0.0.1:8372
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Net.Sockets.SocketException: No connection could be made because the target machine actively refused it 127.0.0.1:8372
Source Error:
Line 36: {
Line 37:
Line 38: objectClient = Db4oClientServer.OpenClient("localhost", 8372, "duran", ""); Line 39:
Line 40: context.Items[KEY_DB4O_CLIENT] = objectClient;
I dont understand how to solve this problem. I'm stuck with this from the past 36 hours.
Please help me
Thanks in anticiption
Upvotes: 0
Views: 135