473,569 Members | 2,759 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

socket error

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!
Nov 19 '05 #1
7 2920
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!
|
|
|

Nov 19 '05 #2
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!
|
|
|

Nov 19 '05 #3
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!
|
|
|


Nov 19 '05 #4
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!
| >> |
| >> |
| >> |
| >>
| >
| >
|
|
|

Nov 19 '05 #5
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!
| | >> |
| | >> |
| | >> |
| | >>
| | >
| | >
| |
| |
| |
|
|

Nov 20 '05 #6
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!
| | >> |
| | >> |
| | >> |
| | >>
| | >
| | >
| |
| |
| |
|
|

Nov 20 '05 #7
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!
| > | | >> |
| > | | >> |
| > | | >> |
| > | | >>
| > | | >
| > | | >
| > | |
| > | |
| > | |
| > |
| > |
| >
|
|
|

Nov 20 '05 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
4617
by: Robert A. van Ginkel | last post by:
Hello Fellow Developer, I use the System.Net.Sockets to send/receive data (no tcpclient/tcplistener), I made a receivethread in my wrapper, the receivethread loops/sleeps while waiting for data and then fires a datareceived event. Within the waitingloop there is a timeout function, but I want the the 'last-time-socket-used' variable set...
2
702
by: Droopy | last post by:
Hi, I try to implement a reusable socket class to send and receive data. It seems to work but I have 2 problems : 1) I rely on Socket.Available to detect that the connection is closed (no more data to expect). Sometimes, Socket.Available returns 0 but the other end of the connection did not close it ! 2) This class will be used by many...
2
2866
by: Rene Sørensen | last post by:
We are 4 students working on a assignment, that our teacher gave use, normally we do this is C++, but the 4 of us, use C# more often that C++ so… We made a small games called reversi, now our job is to make a server, none of us know nothing about socket programming in C#, but we founds some guides for this, and now ,got a server running, but...
1
10053
by: bobano | last post by:
Hi everyone, I am writing a POP3 Client program in Perl. You connect to a POP3 Server and have a running conversation with the mail server using commands from the RFC 1939 Post Office Protocol. This program can perform 5 options from a menu on your POP3 mail by logging in with the correct POP3 server along with a user name and password that you...
2
4027
by: John Nagle | last post by:
Here's a strange little bug. "socket.getaddrinfo" blows up if given a bad domain name containing ".." in Unicode. The same string in ASCII produces the correct "gaierror" exception. Actually, this deserves a documentation mention. The "socket" module, given a Unicode string, calls the International Domain Name parser, "idna.py", which...
10
3554
by: John Nagle | last post by:
Here are three network-related exceptions. These were caught by "except" with no exception type, because none of the more specific exceptions matched. This is what a traceback produced: 1. File "D:\Python24\lib\socket.py", line 295, in read data = self._sock.recv(recv_size) timeout: timed out
14
12730
by: ahlongxp | last post by:
Hi, everyone, I'm implementing a simple client/server protocol. Now I've got a situation: client will send server command,header paires and optionally body. server checks headers and decides whether to accept(read) the body. if server decided to throw(dump) the request's body, it'll send back a response message, such as "resource...
10
7385
by: Hendrik van Rooyen | last post by:
While doing a netstring implementation I noticed that if you build a record up using socket's recv(1), then when you close the remote end down, the recv(1) hangs, despite having a short time out of 0.1 set. If however, you try to receive more than one char, (I tested with 3, did not try 2), then when you shut the remote end down you do not...
2
3653
by: manasap | last post by:
Hi all! I've written a server and a client application using asynchronous sockets.The client sends data packets for every 7 seconds.The server receives the packets. This process proceeds smoothly without any errors but,sometimes I get the following error. "An existing connection was forcibly closed by the remote host." Why is...
0
7612
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7924
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8120
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7672
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
6283
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5512
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5219
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3653
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
937
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.