Re: Killing a thread started with delegate.BeginInvoke()
From: Jako Menkveld (jako.menkveld_at_envalue.ch)
Date: 02/10/05
- Next message: Charles A. Lackman: "MemoryStream??"
- Previous message: PIEBALD: "RE: Nested GroupBoxes"
- In reply to: Alvin Bruney [MVP]: "Re: Killing a thread started with delegate.BeginInvoke()"
- Next in thread: Alvin Bruney [MVP]: "Re: Killing a thread started with delegate.BeginInvoke()"
- Reply: Alvin Bruney [MVP]: "Re: Killing a thread started with delegate.BeginInvoke()"
- Messages sorted by: [ date ] [ thread ]
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
>>
>>
>
>
- Next message: Charles A. Lackman: "MemoryStream??"
- Previous message: PIEBALD: "RE: Nested GroupBoxes"
- In reply to: Alvin Bruney [MVP]: "Re: Killing a thread started with delegate.BeginInvoke()"
- Next in thread: Alvin Bruney [MVP]: "Re: Killing a thread started with delegate.BeginInvoke()"
- Reply: Alvin Bruney [MVP]: "Re: Killing a thread started with delegate.BeginInvoke()"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|