Re: socket error
- From: <param@xxxxxxxxxxxxxxxx>
- Date: Sat, 12 Nov 2005 14:20:45 -0600
It ended up with something to do with our Proxy configuration. On both the
1.1 & 2.0 boxes I had the MS Firewall Client installed. This worked fine on
the 1.1 box, but on the 2.0 box for some reason the httpwebrequest couldnt
get out. I un-installed the firewall client on the 2.0 box and it ended up
working fine? Our proxy server (isa 2004) was configured to allow all
outbound connections for both the boxes. So I dont see where the problem
was?
TIA!
<param@xxxxxxxxxxxxxxxx> wrote in message
news:OePTDKt5FHA.444@xxxxxxxxxxxxxxxxxxxxxxx
> Steve,
>
> 1. Yes I can visit that page directly through a browser on the server.
> 2. The same code snippet works on another server on the same network
> running net 1.1.
> 3. The vdir is running with anonymous authentication turned on. It's
> application pool is configured to run under a normal user account named
> "appone".
>
> I cant think of anything else?
>
> "Steven Cheng[MSFT]" <stcheng@xxxxxxxxxxxxxxxxxxxx> wrote in message
> news:q4h%23NPs5FHA.2108@xxxxxxxxxxxxxxxxxxxxxxxx
>> Hi Param,
>>
>> Welcome.
>> From your description, you're using HttpWebRequest component to
>> programmatically request an ASP page and encounter underlying connection
>> closed problem. From the code snippet you provided, seems there hasn't
>> any
>> particular things, I'd suggest you try the following things:
>>
>> 1. Whether you can visit that page correctly through browser
>> 2. Whether you can correctly request that page through the same code in a
>> winform or console application.
>>
>> Also, if convenient, would you also provide the detailed authentication
>> setting for that ASP page 's IIS virtual dir?
>>
>> Thanks,
>>
>> Steven Cheng
>> Microsoft Online Support
>>
>> Get Secure! www.microsoft.com/security
>> (This posting is provided "AS IS", with no warranties, and confers no
>> rights.)
>> --------------------
>> | From: <param@xxxxxxxxxxxxxxxx>
>> | Subject: socket error
>> | Date: Thu, 10 Nov 2005 23:24:46 -0600
>> | Lines: 126
>> | X-Priority: 3
>> | X-MSMail-Priority: Normal
>> | X-Newsreader: Microsoft Outlook Express 6.00.2900.2527
>> | X-RFC2646: Format=Flowed; Original
>> | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2527
>> | Message-ID: <#UyE8Ao5FHA.2092@xxxxxxxxxxxxxxxxxxxx>
>> | Newsgroups: microsoft.public.dotnet.framework.aspnet
>> | NNTP-Posting-Host: corp.lazardgroup.com 64.237.78.178
>> | Path: TK2MSFTNGXA02.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP12.phx.gbl
>> | Xref: TK2MSFTNGXA02.phx.gbl
>> microsoft.public.dotnet.framework.aspnet:357281
>> | X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
>> |
>> | Hi all,
>> |
>> | I have a simple .aspx page running on net 2.0 that is trying to do a
>> http
>> | post to a remote server. Here is the code
>> |
>> | Private Function ProcessRequests(ByVal strbody As String) As String
>> |
>> | Dim returnstr As String
>> |
>> | Dim URL As String = "http://www.dydomain.com/test.asp"
>> |
>> | Dim h As HttpWebRequest = CType(WebRequest.Create(URL), HttpWebRequest)
>> |
>> | h.ContentType = "text/xml"
>> |
>> | h.Method = "POST"
>> |
>> | h.ContentLength = Len(strbody)
>> |
>> | h.KeepAlive = True
>> |
>> | h.Referer = "me"
>> |
>> | h.UserAgent = "me"
>> |
>> | Dim s As Stream = h.GetRequestStream()
>> |
>> | Dim sw As New StreamWriter(s)
>> |
>> | sw.Write(strbody)
>> |
>> | sw.Close()
>> |
>> | Dim hr As HttpWebResponse = CType(h.GetResponse, HttpWebResponse)
>> |
>> | Dim s2 As Stream = hr.GetResponseStream
>> |
>> | Dim sr As New StreamReader(s2)
>> |
>> | returnstr = sr.ReadToEnd
>> |
>> | sr.Close()
>> |
>> | h = Nothing
>> |
>> | hr.Close()
>> |
>> | hr = Nothing
>> |
>> | funcend:
>> |
>> | Return returnstr
>> |
>> | End Function
>> |
>> |
>> |
>> | I get an error on the following line:-
>> |
>> |
>> |
>> |
>> |
>> | Server Error in '/' Application.
>> |
>> ----------------------------------------------------------------------------
>> ----
>> |
>> | A socket operation encountered a dead network
>> | 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
>> | encountered a dead network
>> |
>> | Source Error:
>> |
>> | Line 111: h.UserAgent = "me"
>> | Line 112:
>> | Line 113: Dim s As Stream = h.GetRequestStream()
>> | Line 114: Dim sw As New StreamWriter(s)
>> | Line 115: sw.Write(strbody)
>> |
>> | Source File: D:\Website Files\AppOne v2.0\appone
>> remoting\Default.aspx.vb
>> | Line: 113
>> |
>> | Stack Trace:
>> |
>> | [SocketException (0x2742): A socket operation encountered a dead
>> network]
>> | System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot,
>> | SocketAddress socketAddress) +1002146
>> | System.Net.Sockets.Socket.InternalConnect(EndPoint remoteEP) +33
>> | System.Net.ServicePoint.ConnectSocketInternal(Boolean
>> connectFailure,
>> | Socket s4, Socket s6, Socket& socket, IPAddress& address,
>> ConnectSocketState
>> | state, IAsyncResult asyncResult, Int32 timeout, Exception& exception)
>> +431
>> |
>> | [WebException: Unable to connect to the remote server]
>> | System.Net.HttpWebRequest.GetRequestStream() +1504525
>> | _Default.ProcessRequests(Int32 lenderID, String strbody) in
>> D:\Website
>> | Files\AppOne v2.0\appone remoting\Default.aspx.vb:113
>> | _Default.CheckNADAProvider() in D:\Website Files\AppOne v2.0\appone
>> | remoting\Default.aspx.vb:97
>> | _Default.Page_Load(Object sender, EventArgs e) in D:\Website
>> Files\AppOne
>> | v2.0\appone remoting\Default.aspx.vb:15
>> | System.Web.UI.Control.OnLoad(EventArgs e) +99
>> | System.Web.UI.Control.LoadRecursive() +47
>> | System.Web.UI.Page.ProcessRequestMain(Boolean
>> | includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
>> +1061
>> |
>> |
>> |
>> |
>> |
>> |
>> ----------------------------------------------------------------------------
>> ----
>> |
>> | Version Information: Microsoft .NET Framework Version:2.0.50727.42;
>> ASP.NET
>> | Version:2.0.50727.42
>> |
>> |
>> |
>> | This same code works on a .net 1.1 box on the same network. So I know
>> | outbound access is OK. Any ideas? The box with the problems is running
>> | Server 2003 Enterprise SP1 w/ net 2.0 RTM.
>> |
>> | TIA!
>> |
>> |
>> |
>>
>
>
.
- Follow-Ups:
- Re: socket error
- From: Steven Cheng[MSFT]
- Re: socket error
- References:
- socket error
- From: param
- socket error
- Prev by Date: Re: Help with DataSet return values
- Next by Date: Re: Web Config File Editing in ASP.Net 2.0
- Previous by thread: socket error
- Next by thread: Re: socket error
- Index(es):
Relevant Pages
|