A socket operation was attempted to an unreachable host 69.63.176.141

Dec 16, 2009 at 5:41 AM

I'm developing an asp.net application. I have implemented the client site login button and it works fine as far as login but when i reload the page after login I get thie above message. It's coming from the highlighted line below. Any suggestions?

here is a portion of code behind:

        // Authenticated, created session and API object
        _connectSession = new ConnectSession(ApplicationKey, SecretKey);

        if (!_connectSession.IsConnected())
        {
            // Not authenticated, proceed as usual.

        }
        else
        {
            // Authenticated, create API instance
            _facebookAPI = new Api(_connectSession);

            // Load user
            user user = _facebookAPI.Users.GetInfo();


Here are details of the error:

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: A socket operation was attempted to an unreachable host 69.63.176.141:80

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below. 

Stack Trace:


[SocketException (0x2751): A socket operation was attempted to an unreachable host 69.63.176.141:80]
   System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress) +239
   System.Net.Sockets.Socket.InternalConnect(EndPoint remoteEP) +35
   System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure, Socket s4, Socket s6, Socket& socket, IPAddress& address, ConnectSocketState state, IAsyncResult asyncResult, Int32 timeout, Exception& exception) +224

[WebException: Unable to connect to the remote server]
   System.Net.HttpWebRequest.GetRequestStream() +5322142
   Facebook.Rest.RestBase.postRequest(String requestUrl, String postString, Boolean compressHttp) +170
   Facebook.Rest.RestBase.SendRequestSynchronous(IDictionary`2 parameterDictionary, Boolean useSession) +187
   Facebook.Rest.Users.GetInfo(String uids, Boolean isAsync, GetInfoCallback callback, Object state) +311
   Facebook.Rest.Users.GetInfo(Int64 uid) +41
   Facebook.Rest.Users.GetInfo() +15
   _Default.Page_Load(Object sender, EventArgs e) +185
   System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +14
   System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +35
   System.Web.UI.Control.OnLoad(EventArgs e) +99
   System.Web.UI.Control.LoadRecursive() +50
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +627




--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:2.0.50727.3603; ASP.NET Version:2.0.50727.3082

Aug 20, 2010 at 2:47 AM

Please can you advice how this issue got resolved. I am facing similar issue.

Dec 28, 2010 at 6:20 PM

Can you please let me know if the issue gets resolved, i am facing the same issue.

Dec 28, 2010 at 6:28 PM

I believe once I put the code in production, I didn't get the error. For development/testing, I assigned my values to variables ApplicationKey and SecretKey in the code before the line _connectSession = new ConnectSession(ApplicationKey, SecretKey); 

Dec 28, 2010 at 7:24 PM

Hello Saadis01,

With the facebook connect button clicked, in the production mode i am getting this error.

.While in the local machine, i am not getting any error, it just works fine.

The error occur in this line of the file:

  user myuser = _facebookAPI.Users.GetInfo();

the server error is like this

Server Error in '/' Application.

The remote server returned an error: (404) Not Found.

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.WebException: The remote server returned an error: (404) Not Found.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.


Stack Trace:

[WebException: The remote server returned an error: (404) Not Found.]
   System.Net.HttpWebRequest.GetResponse() +7769892
   Facebook.Rest.RestBase.postRequest(String requestUrl, String postString, Boolean compressHttp) +448
   Facebook.Rest.RestBase.SendRequestSynchronous(IDictionary`2 parameterDictionary, Boolean useSession) +331
   Facebook.Rest.Users.GetInfo(String uids, Boolean isAsync, GetInfoCallback callback, Object state) +444
   Facebook.Rest.Users.GetInfo(Int64 uid) +63
   mysite.SiteMaster.Page_Load(Object sender, EventArgs e) in C:\mysite\Site.Master.cs:34
   System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +25
   System.Web.UI.Control.LoadRecursive() +71
   System.Web.UI.Control.LoadRecursive() +190
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3048



Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.1 

<!-- [WebException]: The remote server returned an error: (404) Not Found. at System.Net.HttpWebRequest.GetResponse() at Facebook.Rest.RestBase.postRequest(String requestUrl, String postString, Boolean compressHttp) at Facebook.Rest.RestBase.SendRequestSynchronous(IDictionary`2 parameterDictionary, Boolean useSession) at Facebook.Rest.Users.GetInfo(String uids, Boolean isAsync, GetInfoCallback callback, Object state) at Facebook.Rest.Users.GetInfo(Int64 uid) at TripCross.SiteMaster.Page_Load(Object sender, EventArgs e) in C:\Users\suren\Documents\ricks\RicksFacebook\RicksFacebook\Site.Master.cs:line 34 at System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) at System.Web.UI.Control.LoadRecursive() at System.Web.UI.Control.LoadRecursive() at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) [HttpUnhandledException]: Exception of type 'System.Web.HttpUnhandledException' was thrown. at System.Web.UI.Page.HandleError(Exception e) at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) at System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) at System.Web.UI.Page.ProcessRequest() at System.Web.UI.Page.ProcessRequest(HttpContext context) at ASP.default_aspx.ProcessRequest(HttpContext context) in c:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\root\6cfbf2dc\5474d4d\App_Web_m3vyw0zt.1.cs:line 0 at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) --><!-- This error page might contain sensitive information because ASP.NET is configured to show verbose error messages using <customErrors mode="Off"/>. Consider using <customErrors mode="On"/> or <customErrors mode="RemoteOnly"/> in production environments.-->