472,964 Members | 2,569 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,964 software developers and data experts.

Client causing remotable application to freeze

Hi,

I am having a freezing issue with my application. My application serves
several remotable objects, all of which must be initialized before their
use. Furthermore, some of them depend on each other. On my application
startup, I configure the objects usting the RemotingConfiguration class to
load the config file. Then I "ping" each of the objects to call their
constructors. This all works fine if no one is attempting to connect at the
time, but if a client application attempts to connect to my application
while the startup is happening, both the client and my application hang
indefinitely. I am attempting to find a way to block client access to the
objects before they are initialized, but the channel must exist for me to
initialize them. Any help would be greatly appreciated!

-Tim
Nov 15 '05 #1
11 2705

Hi Timothy,

Thank you for posting in MSDN Managed newsgroup.
I will reply you after my research.

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

--------------------
| From: "Timothy Shih" <ts***@sensicast.com>
| Subject: Client causing remotable application to freeze
| Date: Mon, 25 Aug 2003 11:26:00 -0400
| Lines: 17
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
| Message-ID: <O5*************@tk2msftngp13.phx.gbl>
| Newsgroups: microsoft.public.dotnet.languages.csharp
| NNTP-Posting-Host: dsl092-093-226.bos1.dsl.speakeasy.net 66.92.93.226
| Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!tk2msftn gp13.phx.gbl
| Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.languages.csharp:179156
| X-Tomcat-NG: microsoft.public.dotnet.languages.csharp
|
| Hi,
|
| I am having a freezing issue with my application. My application serves
| several remotable objects, all of which must be initialized before their
| use. Furthermore, some of them depend on each other. On my application
| startup, I configure the objects usting the RemotingConfiguration class to
| load the config file. Then I "ping" each of the objects to call their
| constructors. This all works fine if no one is attempting to connect at
the
| time, but if a client application attempts to connect to my application
| while the startup is happening, both the client and my application hang
| indefinitely. I am attempting to find a way to block client access to the
| objects before they are initialized, but the channel must exist for me to
| initialize them. Any help would be greatly appreciated!
|
| -Tim
|
|
|

Nov 15 '05 #2
Ok Jeffrey, thank you for taking the time to look into this!

-Tim
"Jeffrey Tan[MSFT]" <v-*****@online.microsoft.com> wrote in message
news:yW**************@cpmsftngxa06.phx.gbl...

Hi Timothy,

Thank you for posting in MSDN Managed newsgroup.
I will reply you after my research.

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

--------------------
| From: "Timothy Shih" <ts***@sensicast.com>
| Subject: Client causing remotable application to freeze
| Date: Mon, 25 Aug 2003 11:26:00 -0400
| Lines: 17
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
| Message-ID: <O5*************@tk2msftngp13.phx.gbl>
| Newsgroups: microsoft.public.dotnet.languages.csharp
| NNTP-Posting-Host: dsl092-093-226.bos1.dsl.speakeasy.net 66.92.93.226
| Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!tk2msftn gp13.phx.gbl
| Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.languages.csharp:179156 | X-Tomcat-NG: microsoft.public.dotnet.languages.csharp
|
| Hi,
|
| I am having a freezing issue with my application. My application serves
| several remotable objects, all of which must be initialized before their
| use. Furthermore, some of them depend on each other. On my application
| startup, I configure the objects usting the RemotingConfiguration class to | load the config file. Then I "ping" each of the objects to call their
| constructors. This all works fine if no one is attempting to connect at
the
| time, but if a client application attempts to connect to my application
| while the startup is happening, both the client and my application hang
| indefinitely. I am attempting to find a way to block client access to the | objects before they are initialized, but the channel must exist for me to | initialize them. Any help would be greatly appreciated!
|
| -Tim
|
|
|

Nov 15 '05 #3

Hi Timothy,

Thank your for posting in this group.

Do you get any exception from your application?
If you get, please show me the exception.
The remotable objects will not be initialized until your client create a
instance of it, so what
does your initialize mean?
Is your connection synchronized or asynchronized?

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

--------------------
| From: "Timothy Shih" <ts***@sensicast.com>
| Subject: Client causing remotable application to freeze
| Date: Mon, 25 Aug 2003 11:26:00 -0400
| Lines: 17
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
| Message-ID: <O5*************@tk2msftngp13.phx.gbl>
| Newsgroups: microsoft.public.dotnet.languages.csharp
| NNTP-Posting-Host: dsl092-093-226.bos1.dsl.speakeasy.net 66.92.93.226
| Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!tk2msftn gp13.phx.gbl
| Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.languages.csharp:179156
| X-Tomcat-NG: microsoft.public.dotnet.languages.csharp
|
| Hi,
|
| I am having a freezing issue with my application. My application serves
| several remotable objects, all of which must be initialized before their
| use. Furthermore, some of them depend on each other. On my application
| startup, I configure the objects usting the RemotingConfiguration class to
| load the config file. Then I "ping" each of the objects to call their
| constructors. This all works fine if no one is attempting to connect at
the
| time, but if a client application attempts to connect to my application
| while the startup is happening, both the client and my application hang
| indefinitely. I am attempting to find a way to block client access to the
| objects before they are initialized, but the channel must exist for me to
| initialize them. Any help would be greatly appreciated!
|
| -Tim
|
|
|

Nov 15 '05 #4

Hi Timothy,

Thank you for your information.

Base on my understanding, your activation mode is server side sington.
And your problem seemed related to the class dependency.
I will simulate your problem:
You have class A,B,C in server side.
A has some variables refering instances of B and C, so before initialize
object A, you must
initialize B and C from client side.
So you created a temp client and initialize objects as order B C A.
But during your initialization, if another client connects your server and
wants to use object A,
you application will freeze(Because your objects B and C have not been
initialized).

I think the workaround is putting your initialization of objects B and C in
the constructor of A, then
your temp client is no need and the problem will not arise.

If I misunderstand your meanning, please feel free to let me know.

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

--------------------
| From: "Timothy Shih" <ts***@sensicast.com>
| References: <O5*************@tk2msftngp13.phx.gbl>
<NE**************@cpmsftngxa06.phx.gbl>
| Subject: Re: Client causing remotable application to freeze
| Date: Thu, 28 Aug 2003 08:59:44 -0400
| Lines: 77
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
| Message-ID: <uq**************@TK2MSFTNGP10.phx.gbl>
| Newsgroups: microsoft.public.dotnet.languages.csharp
| NNTP-Posting-Host: dsl092-093-226.bos1.dsl.speakeasy.net 66.92.93.226
| Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTN GP10.phx.gbl
| Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.languages.csharp:180218
| X-Tomcat-NG: microsoft.public.dotnet.languages.csharp
|
| Hi Jeffrey,
|
| No, I don't get any exception as it just hangs indefinitely. Eventually I
| just end the process and restart it. What I do is register the objects,
but
| I do not want the client to initialize it. Therefore I spoof a client and
| ping all the remotable objects on startup so that I can initialize them in
| the correct order (one of the objects is necessary for all of the other
ones
| to run). Basically, i need to create an instance of each of the objects
| before an actual client can attempt to access them. However, the problem
| comes when a client attempts to access the objects as I am initalizing
them
| (thereby disrupting the order of initialization). What I would like is to
be
| able to block client access to the objects until I initialize them on my
| end. Thanks!
|
| Tim
| "Jeffrey Tan[MSFT]" <v-*****@online.microsoft.com> wrote in message
| news:NE**************@cpmsftngxa06.phx.gbl...
| >
| > Hi Timothy,
| >
| > Thank your for posting in this group.
| >
| > Do you get any exception from your application?
| > If you get, please show me the exception.
| > The remotable objects will not be initialized until your client create a
| > instance of it, so what
| > does your initialize mean?
| > Is your connection synchronized or asynchronized?
| >
| > Best regards,
| > Jeffrey Tan
| > Microsoft Online Partner Support
| > Get Secure! - www.microsoft.com/security
| > This posting is provided "as is" with no warranties and confers no
rights.
| >
| > --------------------
| > | From: "Timothy Shih" <ts***@sensicast.com>
| > | Subject: Client causing remotable application to freeze
| > | Date: Mon, 25 Aug 2003 11:26:00 -0400
| > | Lines: 17
| > | X-Priority: 3
| > | X-MSMail-Priority: Normal
| > | X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
| > | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
| > | Message-ID: <O5*************@tk2msftngp13.phx.gbl>
| > | Newsgroups: microsoft.public.dotnet.languages.csharp
| > | NNTP-Posting-Host: dsl092-093-226.bos1.dsl.speakeasy.net 66.92.93.226
| > | Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!tk2msftn gp13.phx.gbl
| > | Xref: cpmsftngxa06.phx.gbl
| microsoft.public.dotnet.languages.csharp:179156
| > | X-Tomcat-NG: microsoft.public.dotnet.languages.csharp
| > |
| > | Hi,
| > |
| > | I am having a freezing issue with my application. My application
serves
| > | several remotable objects, all of which must be initialized before
their
| > | use. Furthermore, some of them depend on each other. On my application
| > | startup, I configure the objects usting the RemotingConfiguration
class
| to
| > | load the config file. Then I "ping" each of the objects to call their
| > | constructors. This all works fine if no one is attempting to connect
at
| > the
| > | time, but if a client application attempts to connect to my
application
| > | while the startup is happening, both the client and my application
hang
| > | indefinitely. I am attempting to find a way to block client access to
| the
| > | objects before they are initialized, but the channel must exist for me
| to
| > | initialize them. Any help would be greatly appreciated!
| > |
| > | -Tim
| > |
| > |
| > |
| >
|
|
|

Nov 15 '05 #5
Hi Jeffrey,

Yes that is basically my problem the way you described it.My first solution
was the one that you suggested (activate the objects from the dependencies
constructor). However, when i did that, my application caused itself to
freeze indefinitely, (in other words, I am attempting to have one remotable
object activate another remotable object and this causes it to freeze). So
in order to solve that, i created a temp client to activate the objects. To
instantiate the class I am simply calling Activator.GetObject() and then
calling a Ping() method to force the singleton object to instantiate. If
there is another methods to instantiate a remotable objects within another
remotable object perhaps I will try to instantiate the the class from within
the dependency's constructor.

Thanks for your help!
Tim
"Jeffrey Tan[MSFT]" <v-*****@online.microsoft.com> wrote in message
news:E2**************@cpmsftngxa06.phx.gbl...

Hi Timothy,

Thank you for your information.

Base on my understanding, your activation mode is server side sington.
And your problem seemed related to the class dependency.
I will simulate your problem:
You have class A,B,C in server side.
A has some variables refering instances of B and C, so before initialize
object A, you must
initialize B and C from client side.
So you created a temp client and initialize objects as order B C A.
But during your initialization, if another client connects your server and
wants to use object A,
you application will freeze(Because your objects B and C have not been
initialized).

I think the workaround is putting your initialization of objects B and C in the constructor of A, then
your temp client is no need and the problem will not arise.

If I misunderstand your meanning, please feel free to let me know.

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

--------------------
| From: "Timothy Shih" <ts***@sensicast.com>
| References: <O5*************@tk2msftngp13.phx.gbl>
<NE**************@cpmsftngxa06.phx.gbl>
| Subject: Re: Client causing remotable application to freeze
| Date: Thu, 28 Aug 2003 08:59:44 -0400
| Lines: 77
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
| Message-ID: <uq**************@TK2MSFTNGP10.phx.gbl>
| Newsgroups: microsoft.public.dotnet.languages.csharp
| NNTP-Posting-Host: dsl092-093-226.bos1.dsl.speakeasy.net 66.92.93.226
| Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTN GP10.phx.gbl
| Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.languages.csharp:180218 | X-Tomcat-NG: microsoft.public.dotnet.languages.csharp
|
| Hi Jeffrey,
|
| No, I don't get any exception as it just hangs indefinitely. Eventually I | just end the process and restart it. What I do is register the objects,
but
| I do not want the client to initialize it. Therefore I spoof a client and | ping all the remotable objects on startup so that I can initialize them in | the correct order (one of the objects is necessary for all of the other
ones
| to run). Basically, i need to create an instance of each of the objects
| before an actual client can attempt to access them. However, the problem
| comes when a client attempts to access the objects as I am initalizing
them
| (thereby disrupting the order of initialization). What I would like is to be
| able to block client access to the objects until I initialize them on my
| end. Thanks!
|
| Tim
| "Jeffrey Tan[MSFT]" <v-*****@online.microsoft.com> wrote in message
| news:NE**************@cpmsftngxa06.phx.gbl...
| >
| > Hi Timothy,
| >
| > Thank your for posting in this group.
| >
| > Do you get any exception from your application?
| > If you get, please show me the exception.
| > The remotable objects will not be initialized until your client create a | > instance of it, so what
| > does your initialize mean?
| > Is your connection synchronized or asynchronized?
| >
| > Best regards,
| > Jeffrey Tan
| > Microsoft Online Partner Support
| > Get Secure! - www.microsoft.com/security
| > This posting is provided "as is" with no warranties and confers no
rights.
| >
| > --------------------
| > | From: "Timothy Shih" <ts***@sensicast.com>
| > | Subject: Client causing remotable application to freeze
| > | Date: Mon, 25 Aug 2003 11:26:00 -0400
| > | Lines: 17
| > | X-Priority: 3
| > | X-MSMail-Priority: Normal
| > | X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
| > | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
| > | Message-ID: <O5*************@tk2msftngp13.phx.gbl>
| > | Newsgroups: microsoft.public.dotnet.languages.csharp
| > | NNTP-Posting-Host: dsl092-093-226.bos1.dsl.speakeasy.net 66.92.93.226 | > | Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!tk2msftn gp13.phx.gbl
| > | Xref: cpmsftngxa06.phx.gbl
| microsoft.public.dotnet.languages.csharp:179156
| > | X-Tomcat-NG: microsoft.public.dotnet.languages.csharp
| > |
| > | Hi,
| > |
| > | I am having a freezing issue with my application. My application
serves
| > | several remotable objects, all of which must be initialized before
their
| > | use. Furthermore, some of them depend on each other. On my application | > | startup, I configure the objects usting the RemotingConfiguration
class
| to
| > | load the config file. Then I "ping" each of the objects to call their | > | constructors. This all works fine if no one is attempting to connect
at
| > the
| > | time, but if a client application attempts to connect to my
application
| > | while the startup is happening, both the client and my application
hang
| > | indefinitely. I am attempting to find a way to block client access to | the
| > | objects before they are initialized, but the channel must exist for me | to
| > | initialize them. Any help would be greatly appreciated!
| > |
| > | -Tim
| > |
| > |
| > |
| >
|
|
|

Nov 15 '05 #6

Hi Timothy,

Can you tell me why it will freeze?
I feel strange that it will freeze.
How do you initialize B and C in A's consturctor?
You initialize them through remoting service or just initialize at server
side?
If you implemented it just at server side, it should not freeze.

If it still does not work, please feel free to let me know.
We are glad to help you.

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

--------------------
| From: "Timothy Shih" <ts***@sensicast.com>
| References: <O5*************@tk2msftngp13.phx.gbl>
<NE**************@cpmsftngxa06.phx.gbl>
<uq**************@TK2MSFTNGP10.phx.gbl>
<E2**************@cpmsftngxa06.phx.gbl>
| Subject: Re: Client causing remotable application to freeze
| Date: Fri, 29 Aug 2003 09:13:38 -0400
| Lines: 170
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
| Message-ID: <#v**************@tk2msftngp13.phx.gbl>
| Newsgroups: microsoft.public.dotnet.languages.csharp
| NNTP-Posting-Host: dsl092-093-226.bos1.dsl.speakeasy.net 66.92.93.226
| Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!tk2msftn gp13.phx.gbl
| Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.languages.csharp:180627
| X-Tomcat-NG: microsoft.public.dotnet.languages.csharp
|
| Hi Jeffrey,
|
| Yes that is basically my problem the way you described it.My first
solution
| was the one that you suggested (activate the objects from the dependencies
| constructor). However, when i did that, my application caused itself to
| freeze indefinitely, (in other words, I am attempting to have one
remotable
| object activate another remotable object and this causes it to freeze). So
| in order to solve that, i created a temp client to activate the objects.
To
| instantiate the class I am simply calling Activator.GetObject() and then
| calling a Ping() method to force the singleton object to instantiate. If
| there is another methods to instantiate a remotable objects within another
| remotable object perhaps I will try to instantiate the the class from
within
| the dependency's constructor.
|
| Thanks for your help!
| Tim
| "Jeffrey Tan[MSFT]" <v-*****@online.microsoft.com> wrote in message
| news:E2**************@cpmsftngxa06.phx.gbl...
| >
| > Hi Timothy,
| >
| > Thank you for your information.
| >
| > Base on my understanding, your activation mode is server side sington.
| > And your problem seemed related to the class dependency.
| > I will simulate your problem:
| > You have class A,B,C in server side.
| > A has some variables refering instances of B and C, so before initialize
| > object A, you must
| > initialize B and C from client side.
| > So you created a temp client and initialize objects as order B C A.
| > But during your initialization, if another client connects your server
and
| > wants to use object A,
| > you application will freeze(Because your objects B and C have not been
| > initialized).
| >
| > I think the workaround is putting your initialization of objects B and C
| in
| > the constructor of A, then
| > your temp client is no need and the problem will not arise.
| >
| > If I misunderstand your meanning, please feel free to let me know.
| >
| > Best regards,
| > Jeffrey Tan
| > Microsoft Online Partner Support
| > Get Secure! - www.microsoft.com/security
| > This posting is provided "as is" with no warranties and confers no
rights.
| >
| > --------------------
| > | From: "Timothy Shih" <ts***@sensicast.com>
| > | References: <O5*************@tk2msftngp13.phx.gbl>
| > <NE**************@cpmsftngxa06.phx.gbl>
| > | Subject: Re: Client causing remotable application to freeze
| > | Date: Thu, 28 Aug 2003 08:59:44 -0400
| > | Lines: 77
| > | X-Priority: 3
| > | X-MSMail-Priority: Normal
| > | X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
| > | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
| > | Message-ID: <uq**************@TK2MSFTNGP10.phx.gbl>
| > | Newsgroups: microsoft.public.dotnet.languages.csharp
| > | NNTP-Posting-Host: dsl092-093-226.bos1.dsl.speakeasy.net 66.92.93.226
| > | Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTN GP10.phx.gbl
| > | Xref: cpmsftngxa06.phx.gbl
| microsoft.public.dotnet.languages.csharp:180218
| > | X-Tomcat-NG: microsoft.public.dotnet.languages.csharp
| > |
| > | Hi Jeffrey,
| > |
| > | No, I don't get any exception as it just hangs indefinitely.
Eventually
| I
| > | just end the process and restart it. What I do is register the
objects,
| > but
| > | I do not want the client to initialize it. Therefore I spoof a client
| and
| > | ping all the remotable objects on startup so that I can initialize
them
| in
| > | the correct order (one of the objects is necessary for all of the
other
| > ones
| > | to run). Basically, i need to create an instance of each of the
objects
| > | before an actual client can attempt to access them. However, the
problem
| > | comes when a client attempts to access the objects as I am initalizing
| > them
| > | (thereby disrupting the order of initialization). What I would like is
| to
| > be
| > | able to block client access to the objects until I initialize them on
my
| > | end. Thanks!
| > |
| > | Tim
| > | "Jeffrey Tan[MSFT]" <v-*****@online.microsoft.com> wrote in message
| > | news:NE**************@cpmsftngxa06.phx.gbl...
| > | >
| > | > Hi Timothy,
| > | >
| > | > Thank your for posting in this group.
| > | >
| > | > Do you get any exception from your application?
| > | > If you get, please show me the exception.
| > | > The remotable objects will not be initialized until your client
create
| a
| > | > instance of it, so what
| > | > does your initialize mean?
| > | > Is your connection synchronized or asynchronized?
| > | >
| > | > Best regards,
| > | > Jeffrey Tan
| > | > Microsoft Online Partner Support
| > | > Get Secure! - www.microsoft.com/security
| > | > This posting is provided "as is" with no warranties and confers no
| > rights.
| > | >
| > | > --------------------
| > | > | From: "Timothy Shih" <ts***@sensicast.com>
| > | > | Subject: Client causing remotable application to freeze
| > | > | Date: Mon, 25 Aug 2003 11:26:00 -0400
| > | > | Lines: 17
| > | > | X-Priority: 3
| > | > | X-MSMail-Priority: Normal
| > | > | X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
| > | > | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
| > | > | Message-ID: <O5*************@tk2msftngp13.phx.gbl>
| > | > | Newsgroups: microsoft.public.dotnet.languages.csharp
| > | > | NNTP-Posting-Host: dsl092-093-226.bos1.dsl.speakeasy.net
| 66.92.93.226
| > | > | Path:
cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!tk2msftn gp13.phx.gbl
| > | > | Xref: cpmsftngxa06.phx.gbl
| > | microsoft.public.dotnet.languages.csharp:179156
| > | > | X-Tomcat-NG: microsoft.public.dotnet.languages.csharp
| > | > |
| > | > | Hi,
| > | > |
| > | > | I am having a freezing issue with my application. My application
| > serves
| > | > | several remotable objects, all of which must be initialized before
| > their
| > | > | use. Furthermore, some of them depend on each other. On my
| application
| > | > | startup, I configure the objects usting the RemotingConfiguration
| > class
| > | to
| > | > | load the config file. Then I "ping" each of the objects to call
| their
| > | > | constructors. This all works fine if no one is attempting to
connect
| > at
| > | > the
| > | > | time, but if a client application attempts to connect to my
| > application
| > | > | while the startup is happening, both the client and my application
| > hang
| > | > | indefinitely. I am attempting to find a way to block client access
| to
| > | the
| > | > | objects before they are initialized, but the channel must exist
for
| me
| > | to
| > | > | initialize them. Any help would be greatly appreciated!
| > | > |
| > | > | -Tim
| > | > |
| > | > |
| > | > |
| > | >
| > |
| > |
| > |
| >
|
|
|

Nov 15 '05 #7

Hi Timothy,

Does your project work?
If it still does not work, can you show me more information?
I have asked you some questions in last articles, please check it.

Thanks
Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

--------------------
| From: "Timothy Shih" <ts***@sensicast.com>
| References: <O5*************@tk2msftngp13.phx.gbl>
<NE**************@cpmsftngxa06.phx.gbl>
<uq**************@TK2MSFTNGP10.phx.gbl>
<E2**************@cpmsftngxa06.phx.gbl>
| Subject: Re: Client causing remotable application to freeze
| Date: Fri, 29 Aug 2003 09:13:38 -0400
| Lines: 170
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
| Message-ID: <#v**************@tk2msftngp13.phx.gbl>
| Newsgroups: microsoft.public.dotnet.languages.csharp
| NNTP-Posting-Host: dsl092-093-226.bos1.dsl.speakeasy.net 66.92.93.226
| Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!tk2msftn gp13.phx.gbl
| Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.languages.csharp:180627
| X-Tomcat-NG: microsoft.public.dotnet.languages.csharp
|
| Hi Jeffrey,
|
| Yes that is basically my problem the way you described it.My first
solution
| was the one that you suggested (activate the objects from the dependencies
| constructor). However, when i did that, my application caused itself to
| freeze indefinitely, (in other words, I am attempting to have one
remotable
| object activate another remotable object and this causes it to freeze). So
| in order to solve that, i created a temp client to activate the objects.
To
| instantiate the class I am simply calling Activator.GetObject() and then
| calling a Ping() method to force the singleton object to instantiate. If
| there is another methods to instantiate a remotable objects within another
| remotable object perhaps I will try to instantiate the the class from
within
| the dependency's constructor.
|
| Thanks for your help!
| Tim
| "Jeffrey Tan[MSFT]" <v-*****@online.microsoft.com> wrote in message
| news:E2**************@cpmsftngxa06.phx.gbl...
| >
| > Hi Timothy,
| >
| > Thank you for your information.
| >
| > Base on my understanding, your activation mode is server side sington.
| > And your problem seemed related to the class dependency.
| > I will simulate your problem:
| > You have class A,B,C in server side.
| > A has some variables refering instances of B and C, so before initialize
| > object A, you must
| > initialize B and C from client side.
| > So you created a temp client and initialize objects as order B C A.
| > But during your initialization, if another client connects your server
and
| > wants to use object A,
| > you application will freeze(Because your objects B and C have not been
| > initialized).
| >
| > I think the workaround is putting your initialization of objects B and C
| in
| > the constructor of A, then
| > your temp client is no need and the problem will not arise.
| >
| > If I misunderstand your meanning, please feel free to let me know.
| >
| > Best regards,
| > Jeffrey Tan
| > Microsoft Online Partner Support
| > Get Secure! - www.microsoft.com/security
| > This posting is provided "as is" with no warranties and confers no
rights.
| >
| > --------------------
| > | From: "Timothy Shih" <ts***@sensicast.com>
| > | References: <O5*************@tk2msftngp13.phx.gbl>
| > <NE**************@cpmsftngxa06.phx.gbl>
| > | Subject: Re: Client causing remotable application to freeze
| > | Date: Thu, 28 Aug 2003 08:59:44 -0400
| > | Lines: 77
| > | X-Priority: 3
| > | X-MSMail-Priority: Normal
| > | X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
| > | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
| > | Message-ID: <uq**************@TK2MSFTNGP10.phx.gbl>
| > | Newsgroups: microsoft.public.dotnet.languages.csharp
| > | NNTP-Posting-Host: dsl092-093-226.bos1.dsl.speakeasy.net 66.92.93.226
| > | Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTN GP10.phx.gbl
| > | Xref: cpmsftngxa06.phx.gbl
| microsoft.public.dotnet.languages.csharp:180218
| > | X-Tomcat-NG: microsoft.public.dotnet.languages.csharp
| > |
| > | Hi Jeffrey,
| > |
| > | No, I don't get any exception as it just hangs indefinitely.
Eventually
| I
| > | just end the process and restart it. What I do is register the
objects,
| > but
| > | I do not want the client to initialize it. Therefore I spoof a client
| and
| > | ping all the remotable objects on startup so that I can initialize
them
| in
| > | the correct order (one of the objects is necessary for all of the
other
| > ones
| > | to run). Basically, i need to create an instance of each of the
objects
| > | before an actual client can attempt to access them. However, the
problem
| > | comes when a client attempts to access the objects as I am initalizing
| > them
| > | (thereby disrupting the order of initialization). What I would like is
| to
| > be
| > | able to block client access to the objects until I initialize them on
my
| > | end. Thanks!
| > |
| > | Tim
| > | "Jeffrey Tan[MSFT]" <v-*****@online.microsoft.com> wrote in message
| > | news:NE**************@cpmsftngxa06.phx.gbl...
| > | >
| > | > Hi Timothy,
| > | >
| > | > Thank your for posting in this group.
| > | >
| > | > Do you get any exception from your application?
| > | > If you get, please show me the exception.
| > | > The remotable objects will not be initialized until your client
create
| a
| > | > instance of it, so what
| > | > does your initialize mean?
| > | > Is your connection synchronized or asynchronized?
| > | >
| > | > Best regards,
| > | > Jeffrey Tan
| > | > Microsoft Online Partner Support
| > | > Get Secure! - www.microsoft.com/security
| > | > This posting is provided "as is" with no warranties and confers no
| > rights.
| > | >
| > | > --------------------
| > | > | From: "Timothy Shih" <ts***@sensicast.com>
| > | > | Subject: Client causing remotable application to freeze
| > | > | Date: Mon, 25 Aug 2003 11:26:00 -0400
| > | > | Lines: 17
| > | > | X-Priority: 3
| > | > | X-MSMail-Priority: Normal
| > | > | X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
| > | > | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
| > | > | Message-ID: <O5*************@tk2msftngp13.phx.gbl>
| > | > | Newsgroups: microsoft.public.dotnet.languages.csharp
| > | > | NNTP-Posting-Host: dsl092-093-226.bos1.dsl.speakeasy.net
| 66.92.93.226
| > | > | Path:
cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!tk2msftn gp13.phx.gbl
| > | > | Xref: cpmsftngxa06.phx.gbl
| > | microsoft.public.dotnet.languages.csharp:179156
| > | > | X-Tomcat-NG: microsoft.public.dotnet.languages.csharp
| > | > |
| > | > | Hi,
| > | > |
| > | > | I am having a freezing issue with my application. My application
| > serves
| > | > | several remotable objects, all of which must be initialized before
| > their
| > | > | use. Furthermore, some of them depend on each other. On my
| application
| > | > | startup, I configure the objects usting the RemotingConfiguration
| > class
| > | to
| > | > | load the config file. Then I "ping" each of the objects to call
| their
| > | > | constructors. This all works fine if no one is attempting to
connect
| > at
| > | > the
| > | > | time, but if a client application attempts to connect to my
| > application
| > | > | while the startup is happening, both the client and my application
| > hang
| > | > | indefinitely. I am attempting to find a way to block client access
| to
| > | the
| > | > | objects before they are initialized, but the channel must exist
for
| me
| > | to
| > | > | initialize them. Any help would be greatly appreciated!
| > | > |
| > | > | -Tim
| > | > |
| > | > |
| > | > |
| > | >
| > |
| > |
| > |
| >
|
|
|

Nov 15 '05 #8

Hi Timothy,

I am glad your original problem resolved.
For your new problem, I will do some research on it.
I will reply to you after research.

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

--------------------
| From: "Timothy Shih" <ts***@sensicast.com>
| References: <O5*************@tk2msftngp13.phx.gbl>
<NE**************@cpmsftngxa06.phx.gbl>
<uq**************@TK2MSFTNGP10.phx.gbl>
<E2**************@cpmsftngxa06.phx.gbl>
<#v**************@tk2msftngp13.phx.gbl>
<8p**************@cpmsftngxa06.phx.gbl>
| Subject: Re: Client causing remotable application to freeze
| Date: Fri, 5 Sep 2003 14:35:55 -0400
| Lines: 276
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
| Message-ID: <un*************@TK2MSFTNGP11.phx.gbl>
| Newsgroups: microsoft.public.dotnet.languages.csharp
| NNTP-Posting-Host: dsl092-093-226.bos1.dsl.speakeasy.net 66.92.93.226
| Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTN GP11.phx.gbl
| Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.languages.csharp:182676
| X-Tomcat-NG: microsoft.public.dotnet.languages.csharp
|
| Hi Jeffrey,
|
| Yes, I have resolved the issue, I am able to initialize a remotable object
| through another remotable object. I was attempting to pass a reference to
| the remotable object to a separate class and have that class initialize
it,
| but that led to the freeze. By intializing all remotable objects that a
| given remotable object depends (within that constructor) it does not
matter
| which order the objects are initialized since each one initializes all of
| them. Thanks for your help on this issue, and sorry for not updating you!
|
| In any case, I have encountered a separate problem and I am not sure if
you
| may be of help. In particular, I would like to be notified when an event
| occurs within a remotable objects. However, the object to be notified is
NOT
| remotable, and furthermore, cannot be marked as serializable. This is
| because it contains several threads (System.Threading objects). It seems
| that when I attempt to pass a delegate to the remotable class the compiler
| complains by saying that System.Threading is not marked as serializable.
| Essentially, this class handles requests from a network layer such (both
| RS232 and TCP). The remotable class handles requests from a client (over
TCP
| or HTTP). when an event occurs in the remotable class, I would like the
| network object to be notified.
|
| I have attempted to solve the problem by creating a separate
| "SerializableEventHandler" class which handles events from the remotable
| object and then passes the event down to the network layer, but it still
| complains about the network object not being serializable (essentially I
| added another link to an already broken chain). If you have any way or
idea
| of getting a remotable object to notify a non-remotable, non-serializable
| object of an event (or event making threads serializable!) I would be very
| grateful!
|
| Thanks again,
| Tim
|
| "Jeffrey Tan[MSFT]" <v-*****@online.microsoft.com> wrote in message
| news:8p**************@cpmsftngxa06.phx.gbl...
| >
| > Hi Timothy,
| >
| > Does your project work?
| > If it still does not work, can you show me more information?
| > I have asked you some questions in last articles, please check it.
| >
| > Thanks
| > Best regards,
| > Jeffrey Tan
| > Microsoft Online Partner Support
| > Get Secure! - www.microsoft.com/security
| > This posting is provided "as is" with no warranties and confers no
rights.
| >
| > --------------------
| > | From: "Timothy Shih" <ts***@sensicast.com>
| > | References: <O5*************@tk2msftngp13.phx.gbl>
| > <NE**************@cpmsftngxa06.phx.gbl>
| > <uq**************@TK2MSFTNGP10.phx.gbl>
| > <E2**************@cpmsftngxa06.phx.gbl>
| > | Subject: Re: Client causing remotable application to freeze
| > | Date: Fri, 29 Aug 2003 09:13:38 -0400
| > | Lines: 170
| > | X-Priority: 3
| > | X-MSMail-Priority: Normal
| > | X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
| > | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
| > | Message-ID: <#v**************@tk2msftngp13.phx.gbl>
| > | Newsgroups: microsoft.public.dotnet.languages.csharp
| > | NNTP-Posting-Host: dsl092-093-226.bos1.dsl.speakeasy.net 66.92.93.226
| > | Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!tk2msftn gp13.phx.gbl
| > | Xref: cpmsftngxa06.phx.gbl
| microsoft.public.dotnet.languages.csharp:180627
| > | X-Tomcat-NG: microsoft.public.dotnet.languages.csharp
| > |
| > | Hi Jeffrey,
| > |
| > | Yes that is basically my problem the way you described it.My first
| > solution
| > | was the one that you suggested (activate the objects from the
| dependencies
| > | constructor). However, when i did that, my application caused itself
to
| > | freeze indefinitely, (in other words, I am attempting to have one
| > remotable
| > | object activate another remotable object and this causes it to
freeze).
| So
| > | in order to solve that, i created a temp client to activate the
objects.
| > To
| > | instantiate the class I am simply calling Activator.GetObject() and
then
| > | calling a Ping() method to force the singleton object to instantiate.
If
| > | there is another methods to instantiate a remotable objects within
| another
| > | remotable object perhaps I will try to instantiate the the class from
| > within
| > | the dependency's constructor.
| > |
| > | Thanks for your help!
| > | Tim
| > | "Jeffrey Tan[MSFT]" <v-*****@online.microsoft.com> wrote in message
| > | news:E2**************@cpmsftngxa06.phx.gbl...
| > | >
| > | > Hi Timothy,
| > | >
| > | > Thank you for your information.
| > | >
| > | > Base on my understanding, your activation mode is server side
sington.
| > | > And your problem seemed related to the class dependency.
| > | > I will simulate your problem:
| > | > You have class A,B,C in server side.
| > | > A has some variables refering instances of B and C, so before
| initialize
| > | > object A, you must
| > | > initialize B and C from client side.
| > | > So you created a temp client and initialize objects as order B C A.
| > | > But during your initialization, if another client connects your
server
| > and
| > | > wants to use object A,
| > | > you application will freeze(Because your objects B and C have not
been
| > | > initialized).
| > | >
| > | > I think the workaround is putting your initialization of objects B
and
| C
| > | in
| > | > the constructor of A, then
| > | > your temp client is no need and the problem will not arise.
| > | >
| > | > If I misunderstand your meanning, please feel free to let me know.
| > | >
| > | > Best regards,
| > | > Jeffrey Tan
| > | > Microsoft Online Partner Support
| > | > Get Secure! - www.microsoft.com/security
| > | > This posting is provided "as is" with no warranties and confers no
| > rights.
| > | >
| > | > --------------------
| > | > | From: "Timothy Shih" <ts***@sensicast.com>
| > | > | References: <O5*************@tk2msftngp13.phx.gbl>
| > | > <NE**************@cpmsftngxa06.phx.gbl>
| > | > | Subject: Re: Client causing remotable application to freeze
| > | > | Date: Thu, 28 Aug 2003 08:59:44 -0400
| > | > | Lines: 77
| > | > | X-Priority: 3
| > | > | X-MSMail-Priority: Normal
| > | > | X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
| > | > | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
| > | > | Message-ID: <uq**************@TK2MSFTNGP10.phx.gbl>
| > | > | Newsgroups: microsoft.public.dotnet.languages.csharp
| > | > | NNTP-Posting-Host: dsl092-093-226.bos1.dsl.speakeasy.net
| 66.92.93.226
| > | > | Path:
cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTN GP10.phx.gbl
| > | > | Xref: cpmsftngxa06.phx.gbl
| > | microsoft.public.dotnet.languages.csharp:180218
| > | > | X-Tomcat-NG: microsoft.public.dotnet.languages.csharp
| > | > |
| > | > | Hi Jeffrey,
| > | > |
| > | > | No, I don't get any exception as it just hangs indefinitely.
| > Eventually
| > | I
| > | > | just end the process and restart it. What I do is register the
| > objects,
| > | > but
| > | > | I do not want the client to initialize it. Therefore I spoof a
| client
| > | and
| > | > | ping all the remotable objects on startup so that I can initialize
| > them
| > | in
| > | > | the correct order (one of the objects is necessary for all of the
| > other
| > | > ones
| > | > | to run). Basically, i need to create an instance of each of the
| > objects
| > | > | before an actual client can attempt to access them. However, the
| > problem
| > | > | comes when a client attempts to access the objects as I am
| initalizing
| > | > them
| > | > | (thereby disrupting the order of initialization). What I would
like
| is
| > | to
| > | > be
| > | > | able to block client access to the objects until I initialize them
| on
| > my
| > | > | end. Thanks!
| > | > |
| > | > | Tim
| > | > | "Jeffrey Tan[MSFT]" <v-*****@online.microsoft.com> wrote in
message
| > | > | news:NE**************@cpmsftngxa06.phx.gbl...
| > | > | >
| > | > | > Hi Timothy,
| > | > | >
| > | > | > Thank your for posting in this group.
| > | > | >
| > | > | > Do you get any exception from your application?
| > | > | > If you get, please show me the exception.
| > | > | > The remotable objects will not be initialized until your client
| > create
| > | a
| > | > | > instance of it, so what
| > | > | > does your initialize mean?
| > | > | > Is your connection synchronized or asynchronized?
| > | > | >
| > | > | > Best regards,
| > | > | > Jeffrey Tan
| > | > | > Microsoft Online Partner Support
| > | > | > Get Secure! - www.microsoft.com/security
| > | > | > This posting is provided "as is" with no warranties and confers
no
| > | > rights.
| > | > | >
| > | > | > --------------------
| > | > | > | From: "Timothy Shih" <ts***@sensicast.com>
| > | > | > | Subject: Client causing remotable application to freeze
| > | > | > | Date: Mon, 25 Aug 2003 11:26:00 -0400
| > | > | > | Lines: 17
| > | > | > | X-Priority: 3
| > | > | > | X-MSMail-Priority: Normal
| > | > | > | X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
| > | > | > | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
| > | > | > | Message-ID: <O5*************@tk2msftngp13.phx.gbl>
| > | > | > | Newsgroups: microsoft.public.dotnet.languages.csharp
| > | > | > | NNTP-Posting-Host: dsl092-093-226.bos1.dsl.speakeasy.net
| > | 66.92.93.226
| > | > | > | Path:
| > cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!tk2msftn gp13.phx.gbl
| > | > | > | Xref: cpmsftngxa06.phx.gbl
| > | > | microsoft.public.dotnet.languages.csharp:179156
| > | > | > | X-Tomcat-NG: microsoft.public.dotnet.languages.csharp
| > | > | > |
| > | > | > | Hi,
| > | > | > |
| > | > | > | I am having a freezing issue with my application. My
application
| > | > serves
| > | > | > | several remotable objects, all of which must be initialized
| before
| > | > their
| > | > | > | use. Furthermore, some of them depend on each other. On my
| > | application
| > | > | > | startup, I configure the objects usting the
| RemotingConfiguration
| > | > class
| > | > | to
| > | > | > | load the config file. Then I "ping" each of the objects to
call
| > | their
| > | > | > | constructors. This all works fine if no one is attempting to
| > connect
| > | > at
| > | > | > the
| > | > | > | time, but if a client application attempts to connect to my
| > | > application
| > | > | > | while the startup is happening, both the client and my
| application
| > | > hang
| > | > | > | indefinitely. I am attempting to find a way to block client
| access
| > | to
| > | > | the
| > | > | > | objects before they are initialized, but the channel must
exist
| > for
| > | me
| > | > | to
| > | > | > | initialize them. Any help would be greatly appreciated!
| > | > | > |
| > | > | > | -Tim
| > | > | > |
| > | > | > |
| > | > | > |
| > | > | >
| > | > |
| > | > |
| > | > |
| > | >
| > |
| > |
| > |
| >
|
|
|

Nov 15 '05 #9

Hi Timothy,

I do not quite undertand why the client class object can not be serialized.
Why the object contains several thread object so it can not be serialized?
I have created a class object whose constructor contains some thread
object,
but I succeeded serialize this class object.

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

--------------------
| From: "Timothy Shih" <ts***@sensicast.com>
| References: <O5*************@tk2msftngp13.phx.gbl>
<NE**************@cpmsftngxa06.phx.gbl>
<uq**************@TK2MSFTNGP10.phx.gbl>
<E2**************@cpmsftngxa06.phx.gbl>
<#v**************@tk2msftngp13.phx.gbl>
<8p**************@cpmsftngxa06.phx.gbl>
| Subject: Re: Client causing remotable application to freeze
| Date: Fri, 5 Sep 2003 14:35:55 -0400
| Lines: 276
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
| Message-ID: <un*************@TK2MSFTNGP11.phx.gbl>
| Newsgroups: microsoft.public.dotnet.languages.csharp
| NNTP-Posting-Host: dsl092-093-226.bos1.dsl.speakeasy.net 66.92.93.226
| Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTN GP11.phx.gbl
| Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.languages.csharp:182676
| X-Tomcat-NG: microsoft.public.dotnet.languages.csharp
|
| Hi Jeffrey,
|
| Yes, I have resolved the issue, I am able to initialize a remotable object
| through another remotable object. I was attempting to pass a reference to
| the remotable object to a separate class and have that class initialize
it,
| but that led to the freeze. By intializing all remotable objects that a
| given remotable object depends (within that constructor) it does not
matter
| which order the objects are initialized since each one initializes all of
| them. Thanks for your help on this issue, and sorry for not updating you!
|
| In any case, I have encountered a separate problem and I am not sure if
you
| may be of help. In particular, I would like to be notified when an event
| occurs within a remotable objects. However, the object to be notified is
NOT
| remotable, and furthermore, cannot be marked as serializable. This is
| because it contains several threads (System.Threading objects). It seems
| that when I attempt to pass a delegate to the remotable class the compiler
| complains by saying that System.Threading is not marked as serializable.
| Essentially, this class handles requests from a network layer such (both
| RS232 and TCP). The remotable class handles requests from a client (over
TCP
| or HTTP). when an event occurs in the remotable class, I would like the
| network object to be notified.
|
| I have attempted to solve the problem by creating a separate
| "SerializableEventHandler" class which handles events from the remotable
| object and then passes the event down to the network layer, but it still
| complains about the network object not being serializable (essentially I
| added another link to an already broken chain). If you have any way or
idea
| of getting a remotable object to notify a non-remotable, non-serializable
| object of an event (or event making threads serializable!) I would be very
| grateful!
|
| Thanks again,
| Tim
|
| "Jeffrey Tan[MSFT]" <v-*****@online.microsoft.com> wrote in message
| news:8p**************@cpmsftngxa06.phx.gbl...
| >
| > Hi Timothy,
| >
| > Does your project work?
| > If it still does not work, can you show me more information?
| > I have asked you some questions in last articles, please check it.
| >
| > Thanks
| > Best regards,
| > Jeffrey Tan
| > Microsoft Online Partner Support
| > Get Secure! - www.microsoft.com/security
| > This posting is provided "as is" with no warranties and confers no
rights.
| >
| > --------------------
| > | From: "Timothy Shih" <ts***@sensicast.com>
| > | References: <O5*************@tk2msftngp13.phx.gbl>
| > <NE**************@cpmsftngxa06.phx.gbl>
| > <uq**************@TK2MSFTNGP10.phx.gbl>
| > <E2**************@cpmsftngxa06.phx.gbl>
| > | Subject: Re: Client causing remotable application to freeze
| > | Date: Fri, 29 Aug 2003 09:13:38 -0400
| > | Lines: 170
| > | X-Priority: 3
| > | X-MSMail-Priority: Normal
| > | X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
| > | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
| > | Message-ID: <#v**************@tk2msftngp13.phx.gbl>
| > | Newsgroups: microsoft.public.dotnet.languages.csharp
| > | NNTP-Posting-Host: dsl092-093-226.bos1.dsl.speakeasy.net 66.92.93.226
| > | Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!tk2msftn gp13.phx.gbl
| > | Xref: cpmsftngxa06.phx.gbl
| microsoft.public.dotnet.languages.csharp:180627
| > | X-Tomcat-NG: microsoft.public.dotnet.languages.csharp
| > |
| > | Hi Jeffrey,
| > |
| > | Yes that is basically my problem the way you described it.My first
| > solution
| > | was the one that you suggested (activate the objects from the
| dependencies
| > | constructor). However, when i did that, my application caused itself
to
| > | freeze indefinitely, (in other words, I am attempting to have one
| > remotable
| > | object activate another remotable object and this causes it to
freeze).
| So
| > | in order to solve that, i created a temp client to activate the
objects.
| > To
| > | instantiate the class I am simply calling Activator.GetObject() and
then
| > | calling a Ping() method to force the singleton object to instantiate.
If
| > | there is another methods to instantiate a remotable objects within
| another
| > | remotable object perhaps I will try to instantiate the the class from
| > within
| > | the dependency's constructor.
| > |
| > | Thanks for your help!
| > | Tim
| > | "Jeffrey Tan[MSFT]" <v-*****@online.microsoft.com> wrote in message
| > | news:E2**************@cpmsftngxa06.phx.gbl...
| > | >
| > | > Hi Timothy,
| > | >
| > | > Thank you for your information.
| > | >
| > | > Base on my understanding, your activation mode is server side
sington.
| > | > And your problem seemed related to the class dependency.
| > | > I will simulate your problem:
| > | > You have class A,B,C in server side.
| > | > A has some variables refering instances of B and C, so before
| initialize
| > | > object A, you must
| > | > initialize B and C from client side.
| > | > So you created a temp client and initialize objects as order B C A.
| > | > But during your initialization, if another client connects your
server
| > and
| > | > wants to use object A,
| > | > you application will freeze(Because your objects B and C have not
been
| > | > initialized).
| > | >
| > | > I think the workaround is putting your initialization of objects B
and
| C
| > | in
| > | > the constructor of A, then
| > | > your temp client is no need and the problem will not arise.
| > | >
| > | > If I misunderstand your meanning, please feel free to let me know.
| > | >
| > | > Best regards,
| > | > Jeffrey Tan
| > | > Microsoft Online Partner Support
| > | > Get Secure! - www.microsoft.com/security
| > | > This posting is provided "as is" with no warranties and confers no
| > rights.
| > | >
| > | > --------------------
| > | > | From: "Timothy Shih" <ts***@sensicast.com>
| > | > | References: <O5*************@tk2msftngp13.phx.gbl>
| > | > <NE**************@cpmsftngxa06.phx.gbl>
| > | > | Subject: Re: Client causing remotable application to freeze
| > | > | Date: Thu, 28 Aug 2003 08:59:44 -0400
| > | > | Lines: 77
| > | > | X-Priority: 3
| > | > | X-MSMail-Priority: Normal
| > | > | X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
| > | > | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
| > | > | Message-ID: <uq**************@TK2MSFTNGP10.phx.gbl>
| > | > | Newsgroups: microsoft.public.dotnet.languages.csharp
| > | > | NNTP-Posting-Host: dsl092-093-226.bos1.dsl.speakeasy.net
| 66.92.93.226
| > | > | Path:
cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTN GP10.phx.gbl
| > | > | Xref: cpmsftngxa06.phx.gbl
| > | microsoft.public.dotnet.languages.csharp:180218
| > | > | X-Tomcat-NG: microsoft.public.dotnet.languages.csharp
| > | > |
| > | > | Hi Jeffrey,
| > | > |
| > | > | No, I don't get any exception as it just hangs indefinitely.
| > Eventually
| > | I
| > | > | just end the process and restart it. What I do is register the
| > objects,
| > | > but
| > | > | I do not want the client to initialize it. Therefore I spoof a
| client
| > | and
| > | > | ping all the remotable objects on startup so that I can initialize
| > them
| > | in
| > | > | the correct order (one of the objects is necessary for all of the
| > other
| > | > ones
| > | > | to run). Basically, i need to create an instance of each of the
| > objects
| > | > | before an actual client can attempt to access them. However, the
| > problem
| > | > | comes when a client attempts to access the objects as I am
| initalizing
| > | > them
| > | > | (thereby disrupting the order of initialization). What I would
like
| is
| > | to
| > | > be
| > | > | able to block client access to the objects until I initialize them
| on
| > my
| > | > | end. Thanks!
| > | > |
| > | > | Tim
| > | > | "Jeffrey Tan[MSFT]" <v-*****@online.microsoft.com> wrote in
message
| > | > | news:NE**************@cpmsftngxa06.phx.gbl...
| > | > | >
| > | > | > Hi Timothy,
| > | > | >
| > | > | > Thank your for posting in this group.
| > | > | >
| > | > | > Do you get any exception from your application?
| > | > | > If you get, please show me the exception.
| > | > | > The remotable objects will not be initialized until your client
| > create
| > | a
| > | > | > instance of it, so what
| > | > | > does your initialize mean?
| > | > | > Is your connection synchronized or asynchronized?
| > | > | >
| > | > | > Best regards,
| > | > | > Jeffrey Tan
| > | > | > Microsoft Online Partner Support
| > | > | > Get Secure! - www.microsoft.com/security
| > | > | > This posting is provided "as is" with no warranties and confers
no
| > | > rights.
| > | > | >
| > | > | > --------------------
| > | > | > | From: "Timothy Shih" <ts***@sensicast.com>
| > | > | > | Subject: Client causing remotable application to freeze
| > | > | > | Date: Mon, 25 Aug 2003 11:26:00 -0400
| > | > | > | Lines: 17
| > | > | > | X-Priority: 3
| > | > | > | X-MSMail-Priority: Normal
| > | > | > | X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
| > | > | > | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
| > | > | > | Message-ID: <O5*************@tk2msftngp13.phx.gbl>
| > | > | > | Newsgroups: microsoft.public.dotnet.languages.csharp
| > | > | > | NNTP-Posting-Host: dsl092-093-226.bos1.dsl.speakeasy.net
| > | 66.92.93.226
| > | > | > | Path:
| > cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!tk2msftn gp13.phx.gbl
| > | > | > | Xref: cpmsftngxa06.phx.gbl
| > | > | microsoft.public.dotnet.languages.csharp:179156
| > | > | > | X-Tomcat-NG: microsoft.public.dotnet.languages.csharp
| > | > | > |
| > | > | > | Hi,
| > | > | > |
| > | > | > | I am having a freezing issue with my application. My
application
| > | > serves
| > | > | > | several remotable objects, all of which must be initialized
| before
| > | > their
| > | > | > | use. Furthermore, some of them depend on each other. On my
| > | application
| > | > | > | startup, I configure the objects usting the
| RemotingConfiguration
| > | > class
| > | > | to
| > | > | > | load the config file. Then I "ping" each of the objects to
call
| > | their
| > | > | > | constructors. This all works fine if no one is attempting to
| > connect
| > | > at
| > | > | > the
| > | > | > | time, but if a client application attempts to connect to my
| > | > application
| > | > | > | while the startup is happening, both the client and my
| application
| > | > hang
| > | > | > | indefinitely. I am attempting to find a way to block client
| access
| > | to
| > | > | the
| > | > | > | objects before they are initialized, but the channel must
exist
| > for
| > | me
| > | > | to
| > | > | > | initialize them. Any help would be greatly appreciated!
| > | > | > |
| > | > | > | -Tim
| > | > | > |
| > | > | > |
| > | > | > |
| > | > | >
| > | > |
| > | > |
| > | > |
| > | >
| > |
| > |
| > |
| >
|
|
|

Nov 15 '05 #10
Hi Jeffrey, I have no clue why this happens. The exact message i get is :
The type System.Threading.Thread in Assembly mscorlib, Version=1.0.5000.0,
Culture=neutral, PublicKeyToken=b77a5c561934e089 is not marked as
serializable.

This may be due to some other underlying problem, but I am not sure what it
is. I solved the issue by making the class inherit from MarshalByRefObject,
I am not sure if this is the best solution.

Thanks for your help!
Tim

"Jeffrey Tan[MSFT]" <v-*****@online.microsoft.com> wrote in message
news:xH**************@cpmsftngxa06.phx.gbl...

Hi Timothy,

I do not quite undertand why the client class object can not be serialized. Why the object contains several thread object so it can not be serialized?
I have created a class object whose constructor contains some thread
object,
but I succeeded serialize this class object.

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

--------------------
| From: "Timothy Shih" <ts***@sensicast.com>
| References: <O5*************@tk2msftngp13.phx.gbl>
<NE**************@cpmsftngxa06.phx.gbl>
<uq**************@TK2MSFTNGP10.phx.gbl>
<E2**************@cpmsftngxa06.phx.gbl>
<#v**************@tk2msftngp13.phx.gbl>
<8p**************@cpmsftngxa06.phx.gbl>
| Subject: Re: Client causing remotable application to freeze
| Date: Fri, 5 Sep 2003 14:35:55 -0400
| Lines: 276
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
| Message-ID: <un*************@TK2MSFTNGP11.phx.gbl>
| Newsgroups: microsoft.public.dotnet.languages.csharp
| NNTP-Posting-Host: dsl092-093-226.bos1.dsl.speakeasy.net 66.92.93.226
| Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTN GP11.phx.gbl
| Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.languages.csharp:182676 | X-Tomcat-NG: microsoft.public.dotnet.languages.csharp
|
| Hi Jeffrey,
|
| Yes, I have resolved the issue, I am able to initialize a remotable object | through another remotable object. I was attempting to pass a reference to | the remotable object to a separate class and have that class initialize
it,
| but that led to the freeze. By intializing all remotable objects that a
| given remotable object depends (within that constructor) it does not
matter
| which order the objects are initialized since each one initializes all of | them. Thanks for your help on this issue, and sorry for not updating you! |
| In any case, I have encountered a separate problem and I am not sure if
you
| may be of help. In particular, I would like to be notified when an event
| occurs within a remotable objects. However, the object to be notified is
NOT
| remotable, and furthermore, cannot be marked as serializable. This is
| because it contains several threads (System.Threading objects). It seems
| that when I attempt to pass a delegate to the remotable class the compiler | complains by saying that System.Threading is not marked as serializable.
| Essentially, this class handles requests from a network layer such (both
| RS232 and TCP). The remotable class handles requests from a client (over
TCP
| or HTTP). when an event occurs in the remotable class, I would like the
| network object to be notified.
|
| I have attempted to solve the problem by creating a separate
| "SerializableEventHandler" class which handles events from the remotable
| object and then passes the event down to the network layer, but it still
| complains about the network object not being serializable (essentially I
| added another link to an already broken chain). If you have any way or
idea
| of getting a remotable object to notify a non-remotable, non-serializable | object of an event (or event making threads serializable!) I would be very | grateful!
|
| Thanks again,
| Tim
|
| "Jeffrey Tan[MSFT]" <v-*****@online.microsoft.com> wrote in message
| news:8p**************@cpmsftngxa06.phx.gbl...
| >
| > Hi Timothy,
| >
| > Does your project work?
| > If it still does not work, can you show me more information?
| > I have asked you some questions in last articles, please check it.
| >
| > Thanks
| > Best regards,
| > Jeffrey Tan
| > Microsoft Online Partner Support
| > Get Secure! - www.microsoft.com/security
| > This posting is provided "as is" with no warranties and confers no
rights.
| >
| > --------------------
| > | From: "Timothy Shih" <ts***@sensicast.com>
| > | References: <O5*************@tk2msftngp13.phx.gbl>
| > <NE**************@cpmsftngxa06.phx.gbl>
| > <uq**************@TK2MSFTNGP10.phx.gbl>
| > <E2**************@cpmsftngxa06.phx.gbl>
| > | Subject: Re: Client causing remotable application to freeze
| > | Date: Fri, 29 Aug 2003 09:13:38 -0400
| > | Lines: 170
| > | X-Priority: 3
| > | X-MSMail-Priority: Normal
| > | X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
| > | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
| > | Message-ID: <#v**************@tk2msftngp13.phx.gbl>
| > | Newsgroups: microsoft.public.dotnet.languages.csharp
| > | NNTP-Posting-Host: dsl092-093-226.bos1.dsl.speakeasy.net 66.92.93.226 | > | Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!tk2msftn gp13.phx.gbl
| > | Xref: cpmsftngxa06.phx.gbl
| microsoft.public.dotnet.languages.csharp:180627
| > | X-Tomcat-NG: microsoft.public.dotnet.languages.csharp
| > |
| > | Hi Jeffrey,
| > |
| > | Yes that is basically my problem the way you described it.My first
| > solution
| > | was the one that you suggested (activate the objects from the
| dependencies
| > | constructor). However, when i did that, my application caused itself
to
| > | freeze indefinitely, (in other words, I am attempting to have one
| > remotable
| > | object activate another remotable object and this causes it to
freeze).
| So
| > | in order to solve that, i created a temp client to activate the
objects.
| > To
| > | instantiate the class I am simply calling Activator.GetObject() and
then
| > | calling a Ping() method to force the singleton object to instantiate. If
| > | there is another methods to instantiate a remotable objects within
| another
| > | remotable object perhaps I will try to instantiate the the class from | > within
| > | the dependency's constructor.
| > |
| > | Thanks for your help!
| > | Tim
| > | "Jeffrey Tan[MSFT]" <v-*****@online.microsoft.com> wrote in message
| > | news:E2**************@cpmsftngxa06.phx.gbl...
| > | >
| > | > Hi Timothy,
| > | >
| > | > Thank you for your information.
| > | >
| > | > Base on my understanding, your activation mode is server side
sington.
| > | > And your problem seemed related to the class dependency.
| > | > I will simulate your problem:
| > | > You have class A,B,C in server side.
| > | > A has some variables refering instances of B and C, so before
| initialize
| > | > object A, you must
| > | > initialize B and C from client side.
| > | > So you created a temp client and initialize objects as order B C A. | > | > But during your initialization, if another client connects your
server
| > and
| > | > wants to use object A,
| > | > you application will freeze(Because your objects B and C have not
been
| > | > initialized).
| > | >
| > | > I think the workaround is putting your initialization of objects B
and
| C
| > | in
| > | > the constructor of A, then
| > | > your temp client is no need and the problem will not arise.
| > | >
| > | > If I misunderstand your meanning, please feel free to let me know.
| > | >
| > | > Best regards,
| > | > Jeffrey Tan
| > | > Microsoft Online Partner Support
| > | > Get Secure! - www.microsoft.com/security
| > | > This posting is provided "as is" with no warranties and confers no
| > rights.
| > | >
| > | > --------------------
| > | > | From: "Timothy Shih" <ts***@sensicast.com>
| > | > | References: <O5*************@tk2msftngp13.phx.gbl>
| > | > <NE**************@cpmsftngxa06.phx.gbl>
| > | > | Subject: Re: Client causing remotable application to freeze
| > | > | Date: Thu, 28 Aug 2003 08:59:44 -0400
| > | > | Lines: 77
| > | > | X-Priority: 3
| > | > | X-MSMail-Priority: Normal
| > | > | X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
| > | > | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
| > | > | Message-ID: <uq**************@TK2MSFTNGP10.phx.gbl>
| > | > | Newsgroups: microsoft.public.dotnet.languages.csharp
| > | > | NNTP-Posting-Host: dsl092-093-226.bos1.dsl.speakeasy.net
| 66.92.93.226
| > | > | Path:
cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTN GP10.phx.gbl
| > | > | Xref: cpmsftngxa06.phx.gbl
| > | microsoft.public.dotnet.languages.csharp:180218
| > | > | X-Tomcat-NG: microsoft.public.dotnet.languages.csharp
| > | > |
| > | > | Hi Jeffrey,
| > | > |
| > | > | No, I don't get any exception as it just hangs indefinitely.
| > Eventually
| > | I
| > | > | just end the process and restart it. What I do is register the
| > objects,
| > | > but
| > | > | I do not want the client to initialize it. Therefore I spoof a
| client
| > | and
| > | > | ping all the remotable objects on startup so that I can initialize | > them
| > | in
| > | > | the correct order (one of the objects is necessary for all of the | > other
| > | > ones
| > | > | to run). Basically, i need to create an instance of each of the
| > objects
| > | > | before an actual client can attempt to access them. However, the
| > problem
| > | > | comes when a client attempts to access the objects as I am
| initalizing
| > | > them
| > | > | (thereby disrupting the order of initialization). What I would
like
| is
| > | to
| > | > be
| > | > | able to block client access to the objects until I initialize them | on
| > my
| > | > | end. Thanks!
| > | > |
| > | > | Tim
| > | > | "Jeffrey Tan[MSFT]" <v-*****@online.microsoft.com> wrote in
message
| > | > | news:NE**************@cpmsftngxa06.phx.gbl...
| > | > | >
| > | > | > Hi Timothy,
| > | > | >
| > | > | > Thank your for posting in this group.
| > | > | >
| > | > | > Do you get any exception from your application?
| > | > | > If you get, please show me the exception.
| > | > | > The remotable objects will not be initialized until your client | > create
| > | a
| > | > | > instance of it, so what
| > | > | > does your initialize mean?
| > | > | > Is your connection synchronized or asynchronized?
| > | > | >
| > | > | > Best regards,
| > | > | > Jeffrey Tan
| > | > | > Microsoft Online Partner Support
| > | > | > Get Secure! - www.microsoft.com/security
| > | > | > This posting is provided "as is" with no warranties and confers no
| > | > rights.
| > | > | >
| > | > | > --------------------
| > | > | > | From: "Timothy Shih" <ts***@sensicast.com>
| > | > | > | Subject: Client causing remotable application to freeze
| > | > | > | Date: Mon, 25 Aug 2003 11:26:00 -0400
| > | > | > | Lines: 17
| > | > | > | X-Priority: 3
| > | > | > | X-MSMail-Priority: Normal
| > | > | > | X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
| > | > | > | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
| > | > | > | Message-ID: <O5*************@tk2msftngp13.phx.gbl>
| > | > | > | Newsgroups: microsoft.public.dotnet.languages.csharp
| > | > | > | NNTP-Posting-Host: dsl092-093-226.bos1.dsl.speakeasy.net
| > | 66.92.93.226
| > | > | > | Path:
| > cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!tk2msftn gp13.phx.gbl
| > | > | > | Xref: cpmsftngxa06.phx.gbl
| > | > | microsoft.public.dotnet.languages.csharp:179156
| > | > | > | X-Tomcat-NG: microsoft.public.dotnet.languages.csharp
| > | > | > |
| > | > | > | Hi,
| > | > | > |
| > | > | > | I am having a freezing issue with my application. My
application
| > | > serves
| > | > | > | several remotable objects, all of which must be initialized
| before
| > | > their
| > | > | > | use. Furthermore, some of them depend on each other. On my
| > | application
| > | > | > | startup, I configure the objects usting the
| RemotingConfiguration
| > | > class
| > | > | to
| > | > | > | load the config file. Then I "ping" each of the objects to
call
| > | their
| > | > | > | constructors. This all works fine if no one is attempting to
| > connect
| > | > at
| > | > | > the
| > | > | > | time, but if a client application attempts to connect to my
| > | > application
| > | > | > | while the startup is happening, both the client and my
| application
| > | > hang
| > | > | > | indefinitely. I am attempting to find a way to block client
| access
| > | to
| > | > | the
| > | > | > | objects before they are initialized, but the channel must
exist
| > for
| > | me
| > | > | to
| > | > | > | initialize them. Any help would be greatly appreciated!
| > | > | > |
| > | > | > | -Tim
| > | > | > |
| > | > | > |
| > | > | > |
| > | > | >
| > | > |
| > | > |
| > | > |
| > | >
| > |
| > |
| > |
| >
|
|
|

Nov 15 '05 #11

Hi Timothy,

I am glad that at last you resolved your problem.
I think you can create a new project and serialize some class objects
that contain some thread objects.
If the problem still arise, I think the problem must be related to your
IDE,
otherwise, it is related your application achitecture.

For you question of best solution, I do not quite certain, because I am
also
new to the .net remoting, I have not much experience on it.

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

--------------------
| From: "Timothy Shih" <ts***@sensicast.com>
| References: <O5*************@tk2msftngp13.phx.gbl>
<NE**************@cpmsftngxa06.phx.gbl>
<uq**************@TK2MSFTNGP10.phx.gbl>
<E2**************@cpmsftngxa06.phx.gbl>
<#v**************@tk2msftngp13.phx.gbl>
<8p**************@cpmsftngxa06.phx.gbl>
<un*************@TK2MSFTNGP11.phx.gbl>
<xH**************@cpmsftngxa06.phx.gbl>
| Subject: Re: Client causing remotable application to freeze
| Date: Wed, 10 Sep 2003 09:08:08 -0400
| Lines: 372
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
| Message-ID: <OZ**************@tk2msftngp13.phx.gbl>
| Newsgroups: microsoft.public.dotnet.languages.csharp
| NNTP-Posting-Host: dsl092-093-226.bos1.dsl.speakeasy.net 66.92.93.226
| Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!tk2msftn gp13.phx.gbl
| Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.languages.csharp:183751
| X-Tomcat-NG: microsoft.public.dotnet.languages.csharp
|
| Hi Jeffrey, I have no clue why this happens. The exact message i get is :
| The type System.Threading.Thread in Assembly mscorlib, Version=1.0.5000.0,
| Culture=neutral, PublicKeyToken=b77a5c561934e089 is not marked as
| serializable.
|
| This may be due to some other underlying problem, but I am not sure what
it
| is. I solved the issue by making the class inherit from
MarshalByRefObject,
| I am not sure if this is the best solution.
|
| Thanks for your help!
| Tim
|
| "Jeffrey Tan[MSFT]" <v-*****@online.microsoft.com> wrote in message
| news:xH**************@cpmsftngxa06.phx.gbl...
| >
| > Hi Timothy,
| >
| > I do not quite undertand why the client class object can not be
| serialized.
| > Why the object contains several thread object so it can not be
serialized?
| > I have created a class object whose constructor contains some thread
| > object,
| > but I succeeded serialize this class object.
| >
| > Best regards,
| > Jeffrey Tan
| > Microsoft Online Partner Support
| > Get Secure! - www.microsoft.com/security
| > This posting is provided "as is" with no warranties and confers no
rights.
| >
| > --------------------
| > | From: "Timothy Shih" <ts***@sensicast.com>
| > | References: <O5*************@tk2msftngp13.phx.gbl>
| > <NE**************@cpmsftngxa06.phx.gbl>
| > <uq**************@TK2MSFTNGP10.phx.gbl>
| > <E2**************@cpmsftngxa06.phx.gbl>
| > <#v**************@tk2msftngp13.phx.gbl>
| > <8p**************@cpmsftngxa06.phx.gbl>
| > | Subject: Re: Client causing remotable application to freeze
| > | Date: Fri, 5 Sep 2003 14:35:55 -0400
| > | Lines: 276
| > | X-Priority: 3
| > | X-MSMail-Priority: Normal
| > | X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
| > | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
| > | Message-ID: <un*************@TK2MSFTNGP11.phx.gbl>
| > | Newsgroups: microsoft.public.dotnet.languages.csharp
| > | NNTP-Posting-Host: dsl092-093-226.bos1.dsl.speakeasy.net 66.92.93.226
| > | Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTN GP11.phx.gbl
| > | Xref: cpmsftngxa06.phx.gbl
| microsoft.public.dotnet.languages.csharp:182676
| > | X-Tomcat-NG: microsoft.public.dotnet.languages.csharp
| > |
| > | Hi Jeffrey,
| > |
| > | Yes, I have resolved the issue, I am able to initialize a remotable
| object
| > | through another remotable object. I was attempting to pass a reference
| to
| > | the remotable object to a separate class and have that class
initialize
| > it,
| > | but that led to the freeze. By intializing all remotable objects that
a
| > | given remotable object depends (within that constructor) it does not
| > matter
| > | which order the objects are initialized since each one initializes all
| of
| > | them. Thanks for your help on this issue, and sorry for not updating
| you!
| > |
| > | In any case, I have encountered a separate problem and I am not sure
if
| > you
| > | may be of help. In particular, I would like to be notified when an
event
| > | occurs within a remotable objects. However, the object to be notified
is
| > NOT
| > | remotable, and furthermore, cannot be marked as serializable. This is
| > | because it contains several threads (System.Threading objects). It
seems
| > | that when I attempt to pass a delegate to the remotable class the
| compiler
| > | complains by saying that System.Threading is not marked as
serializable.
| > | Essentially, this class handles requests from a network layer such
(both
| > | RS232 and TCP). The remotable class handles requests from a client
(over
| > TCP
| > | or HTTP). when an event occurs in the remotable class, I would like
the
| > | network object to be notified.
| > |
| > | I have attempted to solve the problem by creating a separate
| > | "SerializableEventHandler" class which handles events from the
remotable
| > | object and then passes the event down to the network layer, but it
still
| > | complains about the network object not being serializable
(essentially I
| > | added another link to an already broken chain). If you have any way or
| > idea
| > | of getting a remotable object to notify a non-remotable,
| non-serializable
| > | object of an event (or event making threads serializable!) I would be
| very
| > | grateful!
| > |
| > | Thanks again,
| > | Tim
| > |
| > | "Jeffrey Tan[MSFT]" <v-*****@online.microsoft.com> wrote in message
| > | news:8p**************@cpmsftngxa06.phx.gbl...
| > | >
| > | > Hi Timothy,
| > | >
| > | > Does your project work?
| > | > If it still does not work, can you show me more information?
| > | > I have asked you some questions in last articles, please check it.
| > | >
| > | > Thanks
| > | > Best regards,
| > | > Jeffrey Tan
| > | > Microsoft Online Partner Support
| > | > Get Secure! - www.microsoft.com/security
| > | > This posting is provided "as is" with no warranties and confers no
| > rights.
| > | >
| > | > --------------------
| > | > | From: "Timothy Shih" <ts***@sensicast.com>
| > | > | References: <O5*************@tk2msftngp13.phx.gbl>
| > | > <NE**************@cpmsftngxa06.phx.gbl>
| > | > <uq**************@TK2MSFTNGP10.phx.gbl>
| > | > <E2**************@cpmsftngxa06.phx.gbl>
| > | > | Subject: Re: Client causing remotable application to freeze
| > | > | Date: Fri, 29 Aug 2003 09:13:38 -0400
| > | > | Lines: 170
| > | > | X-Priority: 3
| > | > | X-MSMail-Priority: Normal
| > | > | X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
| > | > | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
| > | > | Message-ID: <#v**************@tk2msftngp13.phx.gbl>
| > | > | Newsgroups: microsoft.public.dotnet.languages.csharp
| > | > | NNTP-Posting-Host: dsl092-093-226.bos1.dsl.speakeasy.net
| 66.92.93.226
| > | > | Path:
cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!tk2msftn gp13.phx.gbl
| > | > | Xref: cpmsftngxa06.phx.gbl
| > | microsoft.public.dotnet.languages.csharp:180627
| > | > | X-Tomcat-NG: microsoft.public.dotnet.languages.csharp
| > | > |
| > | > | Hi Jeffrey,
| > | > |
| > | > | Yes that is basically my problem the way you described it.My first
| > | > solution
| > | > | was the one that you suggested (activate the objects from the
| > | dependencies
| > | > | constructor). However, when i did that, my application caused
itself
| > to
| > | > | freeze indefinitely, (in other words, I am attempting to have one
| > | > remotable
| > | > | object activate another remotable object and this causes it to
| > freeze).
| > | So
| > | > | in order to solve that, i created a temp client to activate the
| > objects.
| > | > To
| > | > | instantiate the class I am simply calling Activator.GetObject()
and
| > then
| > | > | calling a Ping() method to force the singleton object to
| instantiate.
| > If
| > | > | there is another methods to instantiate a remotable objects within
| > | another
| > | > | remotable object perhaps I will try to instantiate the the class
| from
| > | > within
| > | > | the dependency's constructor.
| > | > |
| > | > | Thanks for your help!
| > | > | Tim
| > | > | "Jeffrey Tan[MSFT]" <v-*****@online.microsoft.com> wrote in
message
| > | > | news:E2**************@cpmsftngxa06.phx.gbl...
| > | > | >
| > | > | > Hi Timothy,
| > | > | >
| > | > | > Thank you for your information.
| > | > | >
| > | > | > Base on my understanding, your activation mode is server side
| > sington.
| > | > | > And your problem seemed related to the class dependency.
| > | > | > I will simulate your problem:
| > | > | > You have class A,B,C in server side.
| > | > | > A has some variables refering instances of B and C, so before
| > | initialize
| > | > | > object A, you must
| > | > | > initialize B and C from client side.
| > | > | > So you created a temp client and initialize objects as order B C
| A.
| > | > | > But during your initialization, if another client connects your
| > server
| > | > and
| > | > | > wants to use object A,
| > | > | > you application will freeze(Because your objects B and C have
not
| > been
| > | > | > initialized).
| > | > | >
| > | > | > I think the workaround is putting your initialization of
objects B
| > and
| > | C
| > | > | in
| > | > | > the constructor of A, then
| > | > | > your temp client is no need and the problem will not arise.
| > | > | >
| > | > | > If I misunderstand your meanning, please feel free to let me
know.
| > | > | >
| > | > | > Best regards,
| > | > | > Jeffrey Tan
| > | > | > Microsoft Online Partner Support
| > | > | > Get Secure! - www.microsoft.com/security
| > | > | > This posting is provided "as is" with no warranties and confers
no
| > | > rights.
| > | > | >
| > | > | > --------------------
| > | > | > | From: "Timothy Shih" <ts***@sensicast.com>
| > | > | > | References: <O5*************@tk2msftngp13.phx.gbl>
| > | > | > <NE**************@cpmsftngxa06.phx.gbl>
| > | > | > | Subject: Re: Client causing remotable application to freeze
| > | > | > | Date: Thu, 28 Aug 2003 08:59:44 -0400
| > | > | > | Lines: 77
| > | > | > | X-Priority: 3
| > | > | > | X-MSMail-Priority: Normal
| > | > | > | X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
| > | > | > | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
| > | > | > | Message-ID: <uq**************@TK2MSFTNGP10.phx.gbl>
| > | > | > | Newsgroups: microsoft.public.dotnet.languages.csharp
| > | > | > | NNTP-Posting-Host: dsl092-093-226.bos1.dsl.speakeasy.net
| > | 66.92.93.226
| > | > | > | Path:
| > cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTN GP10.phx.gbl
| > | > | > | Xref: cpmsftngxa06.phx.gbl
| > | > | microsoft.public.dotnet.languages.csharp:180218
| > | > | > | X-Tomcat-NG: microsoft.public.dotnet.languages.csharp
| > | > | > |
| > | > | > | Hi Jeffrey,
| > | > | > |
| > | > | > | No, I don't get any exception as it just hangs indefinitely.
| > | > Eventually
| > | > | I
| > | > | > | just end the process and restart it. What I do is register the
| > | > objects,
| > | > | > but
| > | > | > | I do not want the client to initialize it. Therefore I spoof a
| > | client
| > | > | and
| > | > | > | ping all the remotable objects on startup so that I can
| initialize
| > | > them
| > | > | in
| > | > | > | the correct order (one of the objects is necessary for all of
| the
| > | > other
| > | > | > ones
| > | > | > | to run). Basically, i need to create an instance of each of
the
| > | > objects
| > | > | > | before an actual client can attempt to access them. However,
the
| > | > problem
| > | > | > | comes when a client attempts to access the objects as I am
| > | initalizing
| > | > | > them
| > | > | > | (thereby disrupting the order of initialization). What I would
| > like
| > | is
| > | > | to
| > | > | > be
| > | > | > | able to block client access to the objects until I initialize
| them
| > | on
| > | > my
| > | > | > | end. Thanks!
| > | > | > |
| > | > | > | Tim
| > | > | > | "Jeffrey Tan[MSFT]" <v-*****@online.microsoft.com> wrote in
| > message
| > | > | > | news:NE**************@cpmsftngxa06.phx.gbl...
| > | > | > | >
| > | > | > | > Hi Timothy,
| > | > | > | >
| > | > | > | > Thank your for posting in this group.
| > | > | > | >
| > | > | > | > Do you get any exception from your application?
| > | > | > | > If you get, please show me the exception.
| > | > | > | > The remotable objects will not be initialized until your
| client
| > | > create
| > | > | a
| > | > | > | > instance of it, so what
| > | > | > | > does your initialize mean?
| > | > | > | > Is your connection synchronized or asynchronized?
| > | > | > | >
| > | > | > | > Best regards,
| > | > | > | > Jeffrey Tan
| > | > | > | > Microsoft Online Partner Support
| > | > | > | > Get Secure! - www.microsoft.com/security
| > | > | > | > This posting is provided "as is" with no warranties and
| confers
| > no
| > | > | > rights.
| > | > | > | >
| > | > | > | > --------------------
| > | > | > | > | From: "Timothy Shih" <ts***@sensicast.com>
| > | > | > | > | Subject: Client causing remotable application to freeze
| > | > | > | > | Date: Mon, 25 Aug 2003 11:26:00 -0400
| > | > | > | > | Lines: 17
| > | > | > | > | X-Priority: 3
| > | > | > | > | X-MSMail-Priority: Normal
| > | > | > | > | X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
| > | > | > | > | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
| > | > | > | > | Message-ID: <O5*************@tk2msftngp13.phx.gbl>
| > | > | > | > | Newsgroups: microsoft.public.dotnet.languages.csharp
| > | > | > | > | NNTP-Posting-Host: dsl092-093-226.bos1.dsl.speakeasy.net
| > | > | 66.92.93.226
| > | > | > | > | Path:
| > | > cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!tk2msftn gp13.phx.gbl
| > | > | > | > | Xref: cpmsftngxa06.phx.gbl
| > | > | > | microsoft.public.dotnet.languages.csharp:179156
| > | > | > | > | X-Tomcat-NG: microsoft.public.dotnet.languages.csharp
| > | > | > | > |
| > | > | > | > | Hi,
| > | > | > | > |
| > | > | > | > | I am having a freezing issue with my application. My
| > application
| > | > | > serves
| > | > | > | > | several remotable objects, all of which must be
initialized
| > | before
| > | > | > their
| > | > | > | > | use. Furthermore, some of them depend on each other. On my
| > | > | application
| > | > | > | > | startup, I configure the objects usting the
| > | RemotingConfiguration
| > | > | > class
| > | > | > | to
| > | > | > | > | load the config file. Then I "ping" each of the objects to
| > call
| > | > | their
| > | > | > | > | constructors. This all works fine if no one is attempting
to
| > | > connect
| > | > | > at
| > | > | > | > the
| > | > | > | > | time, but if a client application attempts to connect to
my
| > | > | > application
| > | > | > | > | while the startup is happening, both the client and my
| > | application
| > | > | > hang
| > | > | > | > | indefinitely. I am attempting to find a way to block
client
| > | access
| > | > | to
| > | > | > | the
| > | > | > | > | objects before they are initialized, but the channel must
| > exist
| > | > for
| > | > | me
| > | > | > | to
| > | > | > | > | initialize them. Any help would be greatly appreciated!
| > | > | > | > |
| > | > | > | > | -Tim
| > | > | > | > |
| > | > | > | > |
| > | > | > | > |
| > | > | > | >
| > | > | > |
| > | > | > |
| > | > | > |
| > | > | >
| > | > |
| > | > |
| > | > |
| > | >
| > |
| > |
| > |
| >
|
|
|

Nov 15 '05 #12

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

Similar topics

52
by: Dick Moores | last post by:
I need to figure out how to compute pi to base 12, to as many digits as possible. I found this reference, <http://mathworld.wolfram.com/Base.html>, but I really don't understand it well enough....
12
by: serge calderara | last post by:
Dear all, I have an application which is suppose to start another executable process. As soon as that process is running, I need to retrive its handle. The problem of the particular process I am...
0
by: Tim Shih | last post by:
Hi all, I'm relatively new to C# .net remoting and was wondering how to access remotable objects on the client side without specifying the url. In particular, I have a server and a client, the...
2
by: Miguel | last post by:
Hi, I'm developing an application in C# with Windows Forms for my company that is similar to the MSN Messenger. This application uses a webservice for registering users, etc... and as 2...
1
by: Jeff Dillon | last post by:
I'm using the webservice I've created: http://www.emergencyreporting.com/ERSWebService/ERSDispatch.asmx When building a client VB.NET app, and adding a web reference to the above file, I see...
4
by: Nathan | last post by:
I am looking into using web services within a new framework I am putting together and can see the benefit of being able to use a web service to provide access to system by clients. As part of...
0
by: Geoff Wedig | last post by:
Is it possible to create a DLL (pr on unix a .a, .so, etc) from python code, perhaps using freeze or some other application? Freeze seems to assume that it's creating the main program body, but I...
2
by: Wimpie van Lingen | last post by:
Hey I have some more questions with regards to Remoting in .NET 2. I'm using TCP with the Binary formatter. My solution consists of 4 projects: - Class Library containing the server classes...
3
by: =?Utf-8?B?Y2hlbmRyaWNrcw==?= | last post by:
I have a C# winforms application that makes periodic web service calls in background thread to my web service server. These calls work fine almost all the time but on rare occassions the web...
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 4 Oct 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
2
by: giovanniandrean | last post by:
The energy model is structured as follows and uses excel sheets to give input data: 1-Utility.py contains all the functions needed to calculate the variables and other minor things (mentions...
3
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be using a very simple database which has Form (clsForm) & Report (clsReport) classes that simply handle making the calling Form invisible until the Form, or all...
1
by: Teri B | last post by:
Hi, I have created a sub-form Roles. In my course form the user selects the roles assigned to the course. 0ne-to-many. One course many roles. Then I created a report based on the Course form and...
3
by: nia12 | last post by:
Hi there, I am very new to Access so apologies if any of this is obvious/not clear. I am creating a data collection tool for health care employees to complete. It consists of a number of...
0
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be focusing on the Report (clsReport) class. This simply handles making the calling Form invisible until all of the Reports opened by it have been closed, when it...
0
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...
2
by: GKJR | last post by:
Does anyone have a recommendation to build a standalone application to replace an Access database? I have my bookkeeping software I developed in Access that I would like to make available to other...

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.