Thanks for the followup.
Good luck!
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: <pa***@communit y.nospam>
| References: <#U************ **@TK2MSFTNGP12 .phx.gbl>
<q4************ **@TK2MSFTNGXA0 2.phx.gbl>
<Oe************ *@TK2MSFTNGP11. phx.gbl>
<ui************ **@TK2MSFTNGP14 .phx.gbl>
<Pg************ **@TK2MSFTNGXA0 2.phx.gbl>
<Rs************ **@TK2MSFTNGXA0 2.phx.gbl>
| Subject: Re: socket error
| Date: Wed, 16 Nov 2005 12:17:01 -0600
| Lines: 350
| 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: <u1************ **@tk2msftngp13 .phx.gbl>
| Newsgroups: microsoft.publi c.dotnet.framew ork.aspnet
| NNTP-Posting-Host: corp2.lazardgro up.com 70.182.148.88
| Path: TK2MSFTNGXA02.p hx.gbl!TK2MSFTN GP08.phx.gbl!tk 2msftngp13.phx. gbl
| Xref: TK2MSFTNGXA02.p hx.gbl
microsoft.publi c.dotnet.framew ork.aspnet:3586 53
| X-Tomcat-NG: microsoft.publi c.dotnet.framew ork.aspnet
|
| Yes it does. thanks
|
| "Steven Cheng[MSFT]" <st*****@online .microsoft.com> wrote in message
| news:Rs******** ******@TK2MSFTN GXA02.phx.gbl.. .
| > Hi Param,
| >
| > Does the further infomation in my last reply helps? If anything else we
| > can
| > help, please feel free to post here.
| >
| > Regards,
| >
| > Steven Cheng
| > Microsoft Online Support
| >
| > Get Secure!
www.microsoft.com/security
| > (This posting is provided "AS IS", with no warranties, and confers no
| > rights.)
| > --------------------
| > | X-Tomcat-ID: 52205220
| > | References: <#U************ **@TK2MSFTNGP12 .phx.gbl>
| > <q4************ **@TK2MSFTNGXA0 2.phx.gbl>
| > <Oe************ *@TK2MSFTNGP11. phx.gbl>
| > <ui************ **@TK2MSFTNGP14 .phx.gbl>
| > | MIME-Version: 1.0
| > | Content-Type: text/plain
| > | Content-Transfer-Encoding: 7bit
| > | From:
st*****@online. microsoft.com (Steven Cheng[MSFT])
| > | Organization: Microsoft
| > | Date: Mon, 14 Nov 2005 03:06:48 GMT
| > | Subject: Re: socket error
| > | X-Tomcat-NG: microsoft.publi c.dotnet.framew ork.aspnet
| > | Message-ID: <Pg************ **@TK2MSFTNGXA0 2.phx.gbl>
| > | Newsgroups: microsoft.publi c.dotnet.framew ork.aspnet
| > | Lines: 222
| > | Path: TK2MSFTNGXA02.p hx.gbl
| > | Xref: TK2MSFTNGXA02.p hx.gbl
| > microsoft.publi c.dotnet.framew ork.aspnet:3578 11
| > | NNTP-Posting-Host: tomcatimport2.p hx.gbl 10.201.218.182
| > |
| > | Hi Param,
| > |
| > | Thanks for your followup.
| > | I think the behavior you mentioned could be caused by the new
| > configuration
| > | of the
| > | <system.net><de faultProxy>.... ...
| > |
| > | in .net 2.0, which will use the IE setting if there is not default
proxy
| > | configured...
| > | In .net 1.1, there is default setting in machine.config which point
the
| > | default proxy setting is:
| > |
| > | <sytem.net>
| > | ...
| > | <defaultProxy >
| > | <proxy usesystemdefaul t="true"/>
| > | ..........
| > |
| > |
| > | while in .NET 2.0, this is not configured by default in the
| > machine.config.
| > | You can check the setting on your deve machine's machine.config.
Also,
| > | you can override this setting in your Application's application config
| > file
| > | /web.config file...
| > |
| > | Hope helps. 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: <pa***@communit y.nospam>
| > | | References: <#U************ **@TK2MSFTNGP12 .phx.gbl>
| > | <q4************ **@TK2MSFTNGXA0 2.phx.gbl>
| > | <Oe************ *@TK2MSFTNGP11. phx.gbl>
| > | | Subject: Re: socket error
| > | | Date: Sat, 12 Nov 2005 14:20:45 -0600
| > | | Lines: 215
| > | | X-Priority: 3
| > | | X-MSMail-Priority: Normal
| > | | X-Newsreader: Microsoft Outlook Express 6.00.2900.2527
| > | | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2527
| > | | X-RFC2646: Format=Flowed; Response
| > | | Message-ID: <ui************ **@TK2MSFTNGP14 .phx.gbl>
| > | | Newsgroups: microsoft.publi c.dotnet.framew ork.aspnet
| > | | NNTP-Posting-Host: corp2.lazardgro up.com 70.182.148.88
| > | | Path:
TK2MSFTNGXA02.p hx.gbl!TK2MSFTN GP08.phx.gbl!TK 2MSFTNGP14.phx. gbl
| > | | Xref: TK2MSFTNGXA02.p hx.gbl
| > | microsoft.publi c.dotnet.framew ork.aspnet:3576 60
| > | | X-Tomcat-NG: microsoft.publi c.dotnet.framew ork.aspnet
| > | |
| > | | 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!
| > | |
| > | | <pa***@communit y.nospam> wrote in message
| > | | news:Oe******** *****@TK2MSFTNG P11.phx.gbl...
| > | | > 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]" <st*****@online .microsoft.com> wrote in
message
| > | | > news:q4******** ********@TK2MSF TNGXA02.phx.gbl ...
| > | | >> Hi Param,
| > | | >>
| > | | >> Welcome.
| > | | >> From your description, you're using HttpWebRequest component to
| > | | >> programmaticall y 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: <pa***@communit y.nospam>
| > | | >> | 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: <#U************ **@TK2MSFTNGP12 .phx.gbl>
| > | | >> | Newsgroups: microsoft.publi c.dotnet.framew ork.aspnet
| > | | >> | NNTP-Posting-Host: corp.lazardgrou p.com 64.237.78.178
| > | | >> | Path:
| > TK2MSFTNGXA02.p hx.gbl!TK2MSFTN GP08.phx.gbl!TK 2MSFTNGP12.phx. gbl
| > | | >> | Xref: TK2MSFTNGXA02.p hx.gbl
| > | | >> microsoft.publi c.dotnet.framew ork.aspnet:3572 81
| > | | >> | X-Tomcat-NG: microsoft.publi c.dotnet.framew ork.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.co m/test.asp"
| > | | >> |
| > | | >> | Dim h As HttpWebRequest = CType(WebReques t.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.GetRequestStr eam()
| > | | >> |
| > | | >> | Dim sw As New StreamWriter(s)
| > | | >> |
| > | | >> | sw.Write(strbod y)
| > | | >> |
| > | | >> | sw.Close()
| > | | >> |
| > | | >> | Dim hr As HttpWebResponse = CType(h.GetResp onse,
HttpWebResponse )
| > | | >> |
| > | | >> | Dim s2 As Stream = hr.GetResponseS tream
| > | | >> |
| > | | >> | 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.Sock ets.SocketExcep tion: A socket
| > | | >> operation
| > | | >> | encountered a dead network
| > | | >> |
| > | | >> | Source Error:
| > | | >> |
| > | | >> | Line 111: h.UserAgent = "me"
| > | | >> | Line 112:
| > | | >> | Line 113: Dim s As Stream = h.GetRequestStr eam()
| > | | >> | Line 114: Dim sw As New StreamWriter(s)
| > | | >> | Line 115: sw.Write(strbod y)
| > | | >> |
| > | | >> | Source File: D:\Website Files\AppOne v2.0\appone
| > | | >> remoting\Defaul t.aspx.vb
| > | | >> | Line: 113
| > | | >> |
| > | | >> | Stack Trace:
| > | | >> |
| > | | >> | [SocketException (0x2742): A socket operation encountered a
dead
| > | | >> network]
| > | | >> | System.Net.Sock ets.Socket.DoCo nnect(EndPoint
endPointSnapsho t,
| > | | >> | SocketAddress socketAddress) +1002146
| > | | >> | System.Net.Sock ets.Socket.Inte rnalConnect(End Point
remoteEP)
| > +33
| > | | >> | System.Net.Serv icePoint.Connec tSocketInternal (Boolean
| > | | >> connectFailure,
| > | | >> | Socket s4, Socket s6, Socket& socket, IPAddress& address,
| > | | >> ConnectSocketSt ate
| > | | >> | state, IAsyncResult asyncResult, Int32 timeout, Exception&
| > | exception)
| > | | >> +431
| > | | >> |
| > | | >> | [WebException: Unable to connect to the remote server]
| > | | >> | System.Net.Http WebRequest.GetR equestStream() +1504525
| > | | >> | _Default.Proces sRequests(Int32 lenderID, String strbody) in
| > | | >> D:\Website
| > | | >> | Files\AppOne v2.0\appone remoting\Defaul t.aspx.vb:113
| > | | >> | _Default.CheckN ADAProvider() in D:\Website Files\AppOne
| > | v2.0\appone
| > | | >> | remoting\Defaul t.aspx.vb:97
| > | | >> | _Default.Page_L oad(Object sender, EventArgs e) in D:\Website
| > | | >> Files\AppOne
| > | | >> | v2.0\appone remoting\Defaul t.aspx.vb:15
| > | | >> | System.Web.UI.C ontrol.OnLoad(E ventArgs e) +99
| > | | >> | System.Web.UI.C ontrol.LoadRecu rsive() +47
| > | | >> | System.Web.UI.P age.ProcessRequ estMain(Boolean
| > | | >> | includeStagesBe foreAsyncPoint, Boolean
| > includeStagesAf terAsyncPoint)
| > | | >> +1061
| > | | >> |
| > | | >> |
| > | | >> |
| > | | >> |
| > | | >> |
| > | | >> |
| > | | >>
| > |
| >
----------------------------------------------------------------------------
| > | | >> ----
| > | | >> |
| > | | >> | Version Information: Microsoft .NET Framework
| > Version:2.0.507 27.42;
| > | | >> ASP.NET
| > | | >> | Version:2.0.507 27.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!
| > | | >> |
| > | | >> |
| > | | >> |
| > | | >>
| > | | >
| > | | >
| > | |
| > | |
| > | |
| > |
| > |
| >
|
|
|