Re: SocketException from code not caught in try catch or Application_Error

Re: SocketException from code not caught in try catch or Application_Error

am 18.12.2007 18:26:43 von MC

No change! still broke.
Aidy wrote:
> It might be something to do with the fact that you're using "using" inside a
> try block. Try it without the "using".
>
> "mc" wrote in message
> news:4767d662$1@mail.hmgcc.gov.uk...
>
>>I have a function (shown below) that I call to check if a server is
>>present. when a server is present, everything is ok. however when it fails.
>>I get an SocketException fired. On my development machine all seems to work
>>and the exception is fired and caught. however on my production server the
>>exception fires, it's not caught by the try catch and it's also not caught
>>in my application_error handler in Global.asax. Can anyone shed any light
>>on this?
>>
>>private bool CheckServer(string p){
>> try{
>> using (Socket s = new Socket(AddressFamily.Internetwork,
>>SocketType.Stream, ProtocolType.Tcp)){
>> IPEndPoint iep = new IPEndPoint(DNS.GetHostEntry(p).AddressList[0],
>>80);
>> s.Connect(iep);
>> return true;
>> }
>> }
>> catch{
>> return false;
>> }
>>}
>>
>>TIA
>>
>>
>>MC
>
>
>

Re: SocketException from code not caught in try catch or Application_Error

am 19.12.2007 10:55:58 von stcheng

Hi MC,

It is also likely that there is something related to the account running
the application. Is there any proxy that requires to visit the certain
remote server/site? You can try switch the ASP.NET process to a domain
account to see whether it works.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead

This posting is provided "AS IS" with no warranties, and confers no rights.


--------------------
>Date: Tue, 18 Dec 2007 17:26:43 +0000
>From: mc
>Newsgroups: microsoft.public.dotnet.framework.aspnet
>Subject: Re: SocketException from code not caught in try catch or
Application_Error
>
>No change! still broke.
>Aidy wrote:
>> It might be something to do with the fact that you're using "using"
inside a
>> try block. Try it without the "using".
>>
>> "mc" wrote in message
>> news:4767d662$1@mail.hmgcc.gov.uk...
>>
>>>I have a function (shown below) that I call to check if a server is
>>>present. when a server is present, everything is ok. however when it
fails.
>>>I get an SocketException fired. On my development machine all seems to
work
>>>and the exception is fired and caught. however on my production server
the
>>>exception fires, it's not caught by the try catch and it's also not
caught
>>>in my application_error handler in Global.asax. Can anyone shed any
light
>>>on this?
>>>
>>>private bool CheckServer(string p){
>>> try{
>>> using (Socket s = new Socket(AddressFamily.Internetwork,
>>>SocketType.Stream, ProtocolType.Tcp)){
>>> IPEndPoint iep = new
IPEndPoint(DNS.GetHostEntry(p).AddressList[0],
>>>80);
>>> s.Connect(iep);
>>> return true;
>>> }
>>> }
>>> catch{
>>> return false;
>>> }
>>>}
>>>
>>>TIA
>>>
>>>
>>>MC
>>
>>
>>
>

Re: SocketException from code not caught in try catch or Application_Error

am 21.12.2007 13:22:48 von stcheng

Hi MC,

Have you got progress on this? If still need any help, welcome to post here.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead


This posting is provided "AS IS" with no warranties, and confers no rights.


--------------------
>Organization: Microsoft
>Date: Wed, 19 Dec 2007 09:55:58 GMT
>Subject: Re: SocketException from code not caught in try catch or
Application_Error
>
>Hi MC,
>
>It is also likely that there is something related to the account running
>the application. Is there any proxy that requires to visit the certain
>remote server/site? You can try switch the ASP.NET process to a domain
>account to see whether it works.
>
>Sincerely,
>
>Steven Cheng
>
>Microsoft MSDN Online Support Lead
>
>This posting is provided "AS IS" with no warranties, and confers no rights.

Re: SocketException from code not caught in try catch or Application_Error

am 09.01.2008 13:11:14 von MC

The AppPool Identity for the site in question is already a domain account is this the setting you meant.

Consider this closed as I've moved onto an alternative solution, not perfect but it works.
Steven Cheng[MSFT] wrote:
> Hi MC,
>
> It is also likely that there is something related to the account running
> the application. Is there any proxy that requires to visit the certain
> remote server/site? You can try switch the ASP.NET process to a domain
> account to see whether it works.
>
> Sincerely,
>
> Steven Cheng
>
> Microsoft MSDN Online Support Lead
>
> This posting is provided "AS IS" with no warranties, and confers no rights.
>
>
> --------------------
>
>>Date: Tue, 18 Dec 2007 17:26:43 +0000
>>From: mc
>>Newsgroups: microsoft.public.dotnet.framework.aspnet
>>Subject: Re: SocketException from code not caught in try catch or
>
> Application_Error
>
>>No change! still broke.
>>Aidy wrote:
>>
>>>It might be something to do with the fact that you're using "using"
>
> inside a
>
>>>try block. Try it without the "using".
>>>
>>>"mc" wrote in message
>>>news:4767d662$1@mail.hmgcc.gov.uk...
>>>
>>>
>>>>I have a function (shown below) that I call to check if a server is
>>>>present. when a server is present, everything is ok. however when it
>
> fails.
>
>>>>I get an SocketException fired. On my development machine all seems to
>
> work
>
>>>>and the exception is fired and caught. however on my production server
>
> the
>
>>>>exception fires, it's not caught by the try catch and it's also not
>
> caught
>
>>>>in my application_error handler in Global.asax. Can anyone shed any
>
> light
>
>>>>on this?
>>>>
>>>>private bool CheckServer(string p){
>>>> try{
>>>> using (Socket s = new Socket(AddressFamily.Internetwork,
>>>>SocketType.Stream, ProtocolType.Tcp)){
>>>> IPEndPoint iep = new
>
> IPEndPoint(DNS.GetHostEntry(p).AddressList[0],
>
>>>>80);
>>>> s.Connect(iep);
>>>> return true;
>>>> }
>>>> }
>>>> catch{
>>>> return false;
>>>> }
>>>>}
>>>>
>>>>TIA
>>>>
>>>>
>>>>MC
>>>
>>>
>>>
>