Hello,
I need help with remoting issues that i'm trying to overcome.
Firstly, the application that i'm trying to develop has a multiple client single server application (Telephony application). The server code receives events of incoming calls and passes them to the client that is related to the call.
I've seen a lot of examples and i've already read the documentation on remoting and i also have been able to run several examples. My problem is that i cannot find an example on which the server initiates the communication, therefore I've tried to use the client code from the examples on the server side and server code from the examples on the client side. Unfortunately i couldn't make it work. The code that i'm using is the following.
Client Side:
Config:
Server:
On the line marked with red i get the following error:
In the case that i execute only this:
I do not get an error but i do not get anything happening either.
Basically i want some way o be able to notify a specific client if an event occurs on the server.
Can you please help me....
I need help with remoting issues that i'm trying to overcome.
Firstly, the application that i'm trying to develop has a multiple client single server application (Telephony application). The server code receives events of incoming calls and passes them to the client that is related to the call.
I've seen a lot of examples and i've already read the documentation on remoting and i also have been able to run several examples. My problem is that i cannot find an example on which the server initiates the communication, therefore I've tried to use the client code from the examples on the server side and server code from the examples on the client side. Unfortunately i couldn't make it work. The code that i'm using is the following.
VB.NET:
Public Interface IRemotableType
Sub _Name()
Event calledByRemote()
End Interface
Client Side:
VB.NET:
Public Class Listener
Inherits MarshalByRefObject
Implements IRemotableType
Private name As String = "Polys"
Public Event calledByRemoteI() Implements IRemotableType.calledByRemote
Public Sub _Name() Implements IRemotableType._Name
RaiseEvent calledByRemoteI()
End Sub
Public Sub New()
Try
RemotingConfiguration.Configure("somename.config", False)
Debug.WriteLine("Listening for requests. Press enter to exit...")
Catch ex As Exception
WriteToErrorLog(ex.ToString, ex.StackTrace, ex.Message)
End Try
End Sub
End Class
Config:
HTML:
<system.runtime.remoting>
<application>
<service>
<activated type="IRemotableType, IRemotableType"/>
</service>
<channels>
<channel ref="http" port="8989"/>
</channels>
</application>
</system.runtime.remoting>
Server:
VB.NET:
Dim communicator As IRemotableType
[COLOR="Red"]communicator = CType(Activator.GetObject(GetType(IRemotableType), "http://" & IPADDRESS & ":8989/IRemotableType.rem"), IRemotableType)[/COLOR]
On the line marked with red i get the following error:
System.Runtime.Remoting.RemotingException: Requested Service not found
Server stack trace:
at System.Runtime.Remoting.Channels.SoapServerFormatterSink.ProcessMessage(IServerChannelSinkStack sinkStack, IMessage requestMsg, ITransportHeaders requestHeaders, Stream requestStream, IMessage& responseMsg, ITransportHeaders& responseHeaders, Stream& responseStream)
In the case that i execute only this:
VB.NET:
Activator.GetObject(GetType(IRemotableType), "http://" & IPADDRESS & ":8989/IRemotableType.rem")
I do not get an error but i do not get anything happening either.
Basically i want some way o be able to notify a specific client if an event occurs on the server.
Can you please help me....
Last edited: