Re: Killing a thread started with delegate.BeginInvoke()

Tech-Archive recommends: Fix windows errors by optimizing your registry

From: Jako Menkveld (jako.menkveld_at_envalue.ch)
Date: 02/10/05


Date: Thu, 10 Feb 2005 19:51:03 -0000

Alvin

Thanks for the reply, but this leaves me a bit confused.

Where do you specify a connection string when using .NET Remoting? It
sounds like you are referring to database connections?

"Alvin Bruney [MVP]" <vapor at steaming post office> wrote in message
news:uFufQt5DFHA.1188@tk2msftngp13.phx.gbl...
> Why arenm't you keeping remote connections open? Would it not be more
> efficient to open the connection only when it is needed? Modify your
> connection string to force connection pooling to be on (i think it is off
> for remote configurations) if object creating is particularly expensive.
> With this design, you wouldn't need to kill threads.
>
> --
> Regards,
> Alvin Bruney [MVP ASP.NET]
>
> [Shameless Author plug]
> The Microsoft Office Web Components Black Book with .NET
> Now Available @ http://www.lulu.com/owc
> ----------------------------------------------------------
>
>
> "Jako Menkveld" <jako.menkveld@envalue.ch> wrote in message
> news:OTps5$1DFHA.2232@TK2MSFTNGP14.phx.gbl...
>> Sadhu / Sunny
>>
>> Thanks for your replies.
>>
>> OK, I'll have a go at explaining this:
>>
>> I have a server exposing a remote object (on TCP). Then I have clients
>> which connects to the server and calls methods on the remote object as
>> random interval. For performance reasons, I don't break and re-establish
>> the connection everytime, I keep a reference to the remote object and
>> just keep calling it's methods whenever I need them.
>>
>> This sounds like a simple scenario, but the problem comes in when the
>> server shuts down (this can happen in my implementation and I need to
>> cater for this).
>>
>> I mentioned in an post to this newsgroup that I have a problem "killing"
>> the TCP connection when the server shutsdown. This is because the
>> clients still have their side of the connection and for some reason the
>> OS takes over control of the listening port. (see my post: How to "kill"
>> a tcp port, posted 31/01/2005).
>>
>> When the client then tries to call a method on the server, it just hangs
>> without throwing an exception, which means I have to kill the process
>> using Task Manager.
>>
>> To overcome this problem I use an asynchronous delegate to call the
>> method and wait a specified time for the method to return, if it doesn't,
>> I treat it as if the server has been shutdown. What I'm left with after
>> that is the asynchronous delegate's thread which I want to kill.
>>
>> I hope this makes it a bit clearer.
>>
>> Cheers
>> Jako
>>
>>
>> "Sunny" <sunny@newsgroup.nospam> wrote in message
>> news:uYs937rDFHA.628@TK2MSFTNGP15.phx.gbl...
>>> In article <emx2B2eDFHA.208@TK2MSFTNGP12.phx.gbl>,
>>> jako.menkveld@envalue.ch says...
>>>> Is this at all possible?
>>>>
>>>>
>>>>
>>>
>>> Not directly. As sadhu said, they are from the thread pool, so they are
>>> managed by the framework.
>>>
>>> But if you provide more information about what you want to achieve,
>>> maybe someone can come up with workaround.
>>>
>>> Sunny
>>
>>
>
>



Relevant Pages

  • Re: Outgoing POP3 email missing/lost/not received
    ... Funny thing is that I have had this ISP for 8 years and it has always been ... It looks like when you last ran CEICW, you set the ISP's mail server to: ... Internet Connection Wizard. ... After the wizard completes, the following network connection ...
    (microsoft.public.windows.server.sbs)
  • Re: Cannot connect client to server 2003
    ... you need to reconfigure the IP schema of your SBS ... On the SBS 2003 Server open the Server Management console. ... On the Connection Type page, click Broadband, and then click Next. ... Alternate DNS server, type the IP addresses that are provided by your ISP ...
    (microsoft.public.windows.server.sbs)
  • Re: Outgoing POP3 email missing/lost/not received
    ... ISP's mail server instead of the domain name on the ... SUMMARY OF SETTINGS FOR CONFIGURE E-MAIL AND INTERNET ... Internet Connection Wizard. ... After the wizard completes, the following network connection ...
    (microsoft.public.windows.server.sbs)
  • Re: Networking Question - VLANs on SBS 2003 Premium SP1
    ... port on the old router so I now have a segregated WLAN. ... be sure you do not enable any DHCP server in internal network. ... On the Connection Type page, click Broadband, and then click Next. ... On the Network Connection, You must enable and configure the network ...
    (microsoft.public.windows.server.sbs)
  • Re: Urgent! New router and big disaster
    ... In the DHCP Console... ... Right click the DHCP server icon, ... Server Local Area Connection: ... Les Connor [SBS Community Member - SBS MVP] ...
    (microsoft.public.windows.server.sbs)