Problems When Remoting Server Not running

Problems When Remoting Server Not running

Post by Joh » Thu, 29 May 2003 14:42:34



I have a simple Asynchronous Remoting System which logs data to a
database.  The client program activates the remoting call and send an
SQL statement to be executed on the remote machine

Public Sub WriteStatisticalLog(ByVal Command As String)
        'Create instance of object
        Dim myLog As RemoteLogger =
CType(Activator.GetObject(GetType(RemoteLogger),
"tcp://www.myserver.com:9898/clsIntelli.mk"), RemoteLogger)
        'set delgate to handle the call
        Dim Delegate Sub LogStat(ByVal Command As String)
        Dim wlAsyncRes As IAsyncResult

        Dim wlDelegate As New LogStat(AddressOf myLog.LogStat)
        'invoke the remote call
        wlAsyncRes = wlDelegate.BeginInvoke(Command, Nothing, Nothing)

        wlDelegate.EndInvoke(wlAsyncRes)
    End Sub

The Server procedure looks like this

 <OneWay()> Public Sub LogStat(ByVal Command As String)
        'process and log command to database here
         etc......
          etc.....
End sub

The Server component of the system is hosted as a windows service.
Now if that windows service is not running but the client system is
still running and attempts to call the remoting procedure on the
server with the line of code

wlAsyncRes = wlDelegate.BeginInvoke(Command, Nothing, Nothing)

it hangs for up to 30 seconds

Now wlDelegate has been set to
(AddressOf myLog.LogStat)

which is declared as a <OneWay()> procedure.  

Have i not created an ashnchronous remoting object corrently ..... if
i have then how come the system is not behaving ashnchronously if it
hangs and seems to wait for a response from the server when calling
the line of code
wlAsyncRes = wlDelegate.BeginInvoke(Command, Nothing, Nothing)

??????

Not really sure about this.
Has anyone else had the same problem?????

 
 
 

Problems When Remoting Server Not running

Post by Aaro » Fri, 30 May 2003 01:13:09


Hi,

Have you tried commenting the

 wlDelegate.EndInvoke(wlAsyncRes)

line to see if the client still hangs??

I am not 100% on VB but I think the way you are using the
asynchronous delegate is incorrect.  The way you are
doing it, with EndInvoke directly after BeginInvoke
effectively makes it a synchronous call.  

You must pass a delegated method to BeginInvoke and then
call EndInvoke within the delegated method.  The
delegated method gets executed on a different thread from
the BeginInvoke call.

HTH,

Aaron

Quote:>-----Original Message-----
>I have a simple Asynchronous Remoting System which logs
data to a
>database.  The client program activates the remoting
call and send an
>SQL statement to be executed on the remote machine

>Public Sub WriteStatisticalLog(ByVal Command As String)
>        'Create instance of object
>        Dim myLog As RemoteLogger =
>CType(Activator.GetObject(GetType(RemoteLogger),
>"tcp://www.myserver.com:9898/clsIntelli.mk"),
RemoteLogger)
>        'set delgate to handle the call
>        Dim Delegate Sub LogStat(ByVal Command As String)
>        Dim wlAsyncRes As IAsyncResult

>        Dim wlDelegate As New LogStat(AddressOf
myLog.LogStat)
>        'invoke the remote call
>        wlAsyncRes = wlDelegate.BeginInvoke(Command,
Nothing, Nothing)

>        wlDelegate.EndInvoke(wlAsyncRes)
>    End Sub

>The Server procedure looks like this

> <OneWay()> Public Sub LogStat(ByVal Command As String)
>        'process and log command to database here
>         etc......
>          etc.....
>End sub

>The Server component of the system is hosted as a
windows service.
>Now if that windows service is not running but the
client system is
>still running and attempts to call the remoting
procedure on the
>server with the line of code

>wlAsyncRes = wlDelegate.BeginInvoke(Command, Nothing,
Nothing)

>it hangs for up to 30 seconds

>Now wlDelegate has been set to
>(AddressOf myLog.LogStat)

>which is declared as a <OneWay()> procedure.  

>Have i not created an ashnchronous remoting object
corrently ..... if
>i have then how come the system is not behaving

ashnchronously if it

- Show quoted text -

Quote:>hangs and seems to wait for a response from the server
when calling
>the line of code
>wlAsyncRes = wlDelegate.BeginInvoke(Command, Nothing,
Nothing)

>??????

>Not really sure about this.
>Has anyone else had the same problem?????
>.


 
 
 

Problems When Remoting Server Not running

Post by Joh » Fri, 30 May 2003 15:13:30


Thanks Aaron

I will give it a go and let you know how i go..


> Hi,

> Have you tried commenting the

>  wlDelegate.EndInvoke(wlAsyncRes)

> line to see if the client still hangs??

> I am not 100% on VB but I think the way you are using the
> asynchronous delegate is incorrect.  The way you are
> doing it, with EndInvoke directly after BeginInvoke
> effectively makes it a synchronous call.  

> You must pass a delegated method to BeginInvoke and then
> call EndInvoke within the delegated method.  The
> delegated method gets executed on a different thread from
> the BeginInvoke call.

> HTH,

> Aaron

> >-----Original Message-----
> >I have a simple Asynchronous Remoting System which logs
>  data to a
> >database.  The client program activates the remoting
>  call and send an
> >SQL statement to be executed on the remote machine

> >Public Sub WriteStatisticalLog(ByVal Command As String)
> >        'Create instance of object
> >        Dim myLog As RemoteLogger =
> >CType(Activator.GetObject(GetType(RemoteLogger),
> >"tcp://www.myserver.com:9898/clsIntelli.mk"),
>  RemoteLogger)
> >        'set delgate to handle the call
> >        Dim Delegate Sub LogStat(ByVal Command As String)
> >        Dim wlAsyncRes As IAsyncResult

> >        Dim wlDelegate As New LogStat(AddressOf
>  myLog.LogStat)
> >        'invoke the remote call
> >        wlAsyncRes = wlDelegate.BeginInvoke(Command,
>  Nothing, Nothing)

> >        wlDelegate.EndInvoke(wlAsyncRes)
> >    End Sub

> >The Server procedure looks like this

> > <OneWay()> Public Sub LogStat(ByVal Command As String)
> >        'process and log command to database here
> >         etc......
> >          etc.....
> >End sub

> >The Server component of the system is hosted as a
>  windows service.
> >Now if that windows service is not running but the
>  client system is
> >still running and attempts to call the remoting
>  procedure on the
> >server with the line of code

> >wlAsyncRes = wlDelegate.BeginInvoke(Command, Nothing,
>  Nothing)

> >it hangs for up to 30 seconds

> >Now wlDelegate has been set to
> >(AddressOf myLog.LogStat)

> >which is declared as a <OneWay()> procedure.  

> >Have i not created an ashnchronous remoting object
>  corrently ..... if
> >i have then how come the system is not behaving
>  ashnchronously if it
> >hangs and seems to wait for a response from the server
>  when calling
> >the line of code
> >wlAsyncRes = wlDelegate.BeginInvoke(Command, Nothing,
>  Nothing)

> >??????

> >Not really sure about this.
> >Has anyone else had the same problem?????
> >.

 
 
 

1. Application does not run on remote server?

Hi

I am learning Visual Studio .Net and all is fine on my
Laptop, However when I upload the asp application to the
Win2k Advanced Server with .Net SKD installed,
Unfortunatly, it does not run giving the error below: -

Surely I should not have to install Visual Studio .net on
to the remote server?

I would be grateful if you could point me to the
instruction for configuring the remote server.

Many thanks

Salaro

-------------------------------error
Server Error in '/visualstudio' Application.
-----------------------------------------------------------
---------------------

Runtime Error
Description: An application error occurred on the server.
The current custom error settings for this application
prevent the details of the application error from being
viewed remotely (for security reasons). It could, however,
be viewed by browsers running on the local server machine.

Details: To enable the details of this specific error
message to be viewable on remote machines, please create a
<customErrors> tag within a "web.config" configuration
file located in the root directory of the current web
application. This <customErrors> tag should then have
its "mode" attribute set to "Off".

<!-- Web.Config Configuration File -->

<configuration>
    <system.web>
        <customErrors mode="Off"/>
    </system.web>
</configuration>

Notes: The current error page you are seeing can be
replaced by a custom error page by modifying
the "defaultRedirect" attribute of the application's
<customErrors> configuration tag to point to a custom
error page URL.

<!-- Web.Config Configuration File -->

<configuration>
    <system.web>
        <customErrors mode="RemoteOnly"
defaultRedirect="mycustompage.htm"/>
    </system.web>
</configuration>

2. Q: Problems with xemacs-19.11

3. Problems debugging ASP.net app running on remote server.

4. Fast SCSI-2 Device Driver Enhanced Mode; EISA SCSI Host Bus[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D?,[C[C[D[D [DE[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C.

5. site on local machine runs fine, but does not run on the server?

6. line of last occurrence

7. New to prepress: Stick with PC or Jump to Mac?

8. Problem: Could not establish trust relationship with remote server

9. How to run .net remoting server from exe located in other machine?

10. How to check if remoting server is running?

11. how to run a remote server application???