Client causing remotable application to freeze

  • Thread starter Thread starter Timothy Shih
  • Start date Start date
T

Timothy Shih

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
 
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" <[email protected]>
| 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: <[email protected]>
| 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!tk2msftngp13.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
|
|
|
 
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" <[email protected]>
| 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: <[email protected]>
| 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!tk2msftngp13.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
|
|
|
 
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" <[email protected]>
| References: <[email protected]>
<[email protected]>
| 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: <[email protected]>
| 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!TK2MSFTNGP10.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
| | >
| > 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" <[email protected]>
| > | 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: <[email protected]>
| > | 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!tk2msftngp13.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
| > |
| > |
| > |
| >
|
|
|
 
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
 
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" <[email protected]>
| References: <[email protected]>
<[email protected]>
<[email protected]>
<[email protected]>
| 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: <#[email protected]>
| 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!tk2msftngp13.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
| | >
| > 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" <[email protected]>
| > | References: <[email protected]>
| > <[email protected]>
| > | 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: <[email protected]>
| > | 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!TK2MSFTNGP10.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
| > | | > | >
| > | > 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" <[email protected]>
| > | > | 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: <[email protected]>
| > | > | 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!tk2msftngp13.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
| > | > |
| > | > |
| > | > |
| > | >
| > |
| > |
| > |
| >
|
|
|
 
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" <[email protected]>
| References: <[email protected]>
<[email protected]>
<[email protected]>
<[email protected]>
| 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: <#[email protected]>
| 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!tk2msftngp13.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
| | >
| > 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" <[email protected]>
| > | References: <[email protected]>
| > <[email protected]>
| > | 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: <[email protected]>
| > | 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!TK2MSFTNGP10.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
| > | | > | >
| > | > 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" <[email protected]>
| > | > | 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: <[email protected]>
| > | > | 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!tk2msftngp13.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
| > | > |
| > | > |
| > | > |
| > | >
| > |
| > |
| > |
| >
|
|
|
 
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" <[email protected]>
| References: <[email protected]>
<[email protected]>
<[email protected]>
<[email protected]>
<#[email protected]>
<[email protected]>
| 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: <[email protected]>
| 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!TK2MSFTNGP11.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
|
| | >
| > 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" <[email protected]>
| > | References: <[email protected]>
| > <[email protected]>
| > <[email protected]>
| > <[email protected]>
| > | 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: <#[email protected]>
| > | 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!tk2msftngp13.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
| > | | > | >
| > | > 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" <[email protected]>
| > | > | References: <[email protected]>
| > | > <[email protected]>
| > | > | 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: <[email protected]>
| > | > | 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!TK2MSFTNGP10.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
message
| > | > | | > | > | >
| > | > | > 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" <[email protected]>
| > | > | > | 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: <[email protected]>
| > | > | > | 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!tk2msftngp13.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
| > | > | > |
| > | > | > |
| > | > | > |
| > | > | >
| > | > |
| > | > |
| > | > |
| > | >
| > |
| > |
| > |
| >
|
|
|
 
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" <[email protected]>
| References: <[email protected]>
<[email protected]>
<[email protected]>
<[email protected]>
<#[email protected]>
<[email protected]>
| 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: <[email protected]>
| 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!TK2MSFTNGP11.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
|
| | >
| > 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" <[email protected]>
| > | References: <[email protected]>
| > <[email protected]>
| > <[email protected]>
| > <[email protected]>
| > | 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: <#[email protected]>
| > | 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!tk2msftngp13.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
| > | | > | >
| > | > 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" <[email protected]>
| > | > | References: <[email protected]>
| > | > <[email protected]>
| > | > | 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: <[email protected]>
| > | > | 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!TK2MSFTNGP10.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
message
| > | > | | > | > | >
| > | > | > 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" <[email protected]>
| > | > | > | 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: <[email protected]>
| > | > | > | 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!tk2msftngp13.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
| > | > | > |
| > | > | > |
| > | > | > |
| > | > | >
| > | > |
| > | > |
| > | > |
| > | >
| > |
| > |
| > |
| >
|
|
|
 
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
 
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" <[email protected]>
| References: <[email protected]>
<[email protected]>
<[email protected]>
<[email protected]>
<#[email protected]>
<[email protected]>
<[email protected]>
<[email protected]>
| 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: <[email protected]>
| 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!tk2msftngp13.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
|
| | >
| > 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" <[email protected]>
| > | References: <[email protected]>
| > <[email protected]>
| > <[email protected]>
| > <[email protected]>
| > <#[email protected]>
| > <[email protected]>
| > | 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: <[email protected]>
| > | 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!TK2MSFTNGP11.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
| > |
| > | | > | >
| > | > 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" <[email protected]>
| > | > | References: <[email protected]>
| > | > <[email protected]>
| > | > <[email protected]>
| > | > <[email protected]>
| > | > | 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: <#[email protected]>
| > | > | 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!tk2msftngp13.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
message
| > | > | | > | > | >
| > | > | > 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" <[email protected]>
| > | > | > | References: <[email protected]>
| > | > | > <[email protected]>
| > | > | > | 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: <[email protected]>
| > | > | > | 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!TK2MSFTNGP10.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
| > message
| > | > | > | | > | > | > | >
| > | > | > | > 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" <[email protected]>
| > | > | > | > | 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: <[email protected]>
| > | > | > | > | 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!tk2msftngp13.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
| > | > | > | > |
| > | > | > | > |
| > | > | > | > |
| > | > | > | >
| > | > | > |
| > | > | > |
| > | > | > |
| > | > | >
| > | > |
| > | > |
| > | > |
| > | >
| > |
| > |
| > |
| >
|
|
|
 
Back
Top