Click here to Skip to main content
16,005,339 members
Home / Discussions / Visual Basic
   

Visual Basic

 
QuestionDot Net Remoting Pin
PJ_1234516-Oct-07 5:51
PJ_1234516-Oct-07 5:51 
AnswerRe: Dot Net Remoting Pin
Dave Kreskowiak16-Oct-07 6:14
mveDave Kreskowiak16-Oct-07 6:14 
GeneralRe: Dot Net Remoting Pin
PJ_1234516-Oct-07 20:44
PJ_1234516-Oct-07 20:44 
GeneralRe: Dot Net Remoting Pin
Dave Kreskowiak17-Oct-07 2:07
mveDave Kreskowiak17-Oct-07 2:07 
GeneralRe: Dot Net Remoting Pin
PJ_1234517-Oct-07 2:32
PJ_1234517-Oct-07 2:32 
GeneralRe: Dot Net Remoting Pin
PJ_1234517-Oct-07 3:17
PJ_1234517-Oct-07 3:17 
GeneralRe: Dot Net Remoting Pin
Dave Kreskowiak17-Oct-07 4:25
mveDave Kreskowiak17-Oct-07 4:25 
GeneralRe: Dot Net Remoting Pin
PJ_1234517-Oct-07 5:00
PJ_1234517-Oct-07 5:00 
Hi Dave

The system I am working on doesn't use a configuration file
But here is the code
================================================================
Server : This code is run onstart of the service
================================================================
Protected Overrides Sub OnStart(ByVal args() As String)

' Add code here to start your service. This method should set things
' in motion so your service can do its work.
RemotingConfiguration.ApplicationName = "Indicium"
Dim ChannelProps As New Dictionary(Of String, Object)
ChannelProps.Add("port", "50000")
ChannelProps.Add("secure", "false")
ChannelProps.Add("name", "Server")
Dim cProv As New BinaryClientFormatterSinkProvider
Dim sProv As New BinaryServerFormatterSinkProvider
sProv.TypeFilterLevel = Runtime.Serialization.Formatters.TypeFilterLevel.Full
Dim myChannel As New TcpChannel(ChannelProps, cProv, sProv)
ChannelServices.RegisterChannel(myChannel, True)
RemotingConfiguration.RegisterWellKnownServiceType(GetType(RemotingGateway), _
"Indicium", WellKnownObjectMode.SingleCall)
RemotingConfiguration.RegisterWellKnownServiceType(GetType(KVGenerator), _
"KVGenerator", WellKnownObjectMode.SingleCall)
RemotingConfiguration.RegisterWellKnownServiceType(GetType(Importers.BankImporter.Gateway), _
"BankImporter", WellKnownObjectMode.SingleCall)
RemotingConfiguration.RegisterWellKnownServiceType(GetType(Stats.clsGateway), _
"Stats", WellKnownObjectMode.SingleCall)
RemotingConfiguration.CustomErrorsMode = CustomErrorsModes.RemoteOnly
SSIDataInterface.ClientPlug.Init("", "", "")
End Sub
======================================================================
Client
======================================================================
Dim serverIP As String = _MyConfig.serverIP
Dim serverPort As String = _MyConfig.serverPort
_serverAddress = "tcp://" & serverIP & ":" & serverPort
Dim serverURI As String = _serverAddress & "/Indicium"
' Create a connection to the Indicium Server...
Dim ChannelProps As New Dictionary(Of String, Object)
ChannelProps.Add("name", "Client")
ChannelProps.Add("port", serverPort)
ChannelProps.Add("secure", "false")
ChannelProps.Add("username", "Petrus")
ChannelProps.Add("password", "hallo1231983")
Dim cProv As New BinaryClientFormatterSinkProvider
Dim sProv As New BinaryServerFormatterSinkProvider
sProv.TypeFilterLevel = Runtime.Serialization.Formatters.TypeFilterLevel.Full
Dim myChannel As New TcpChannel(ChannelProps, cProv, sProv)
Try
ChannelServices.RegisterChannel(myChannel, True)
Catch ex As Exception
MsgBox("Channel Feed Back : " & ex.ToString())
End Try
IndiciumGateway = CType(Activator.GetObject(GetType(IGateway), serverURI), IGateway)

=================================================================================================
If you suggest i use a configuration file do I use on the server
RemotingConfiguration.Configure()

and would it look like this and what do I need to change to make it work for my setup and what type of assembly should be named in the activated type of assembly and the wellknown type Assembly

<Configuration>
<system.runtime.remoting>
<application>
<service>
<welknown mode="SingleCall" Type="RemotingGateway,IndiciumServer" objecturi="Indicium" />
<activated type="ClientActivatedType, TypeAssembly"/>
</service>
</application>
</system.runtime.remoting>
</Configuration>

PS: Is the assembly type the project name that contains the class that is marshallbyrefOject
GeneralRe: Dot Net Remoting Pin
Dave Kreskowiak17-Oct-07 6:50
mveDave Kreskowiak17-Oct-07 6:50 
GeneralRe: Dot Net Remoting Pin
PJ_1234517-Oct-07 21:12
PJ_1234517-Oct-07 21:12 
GeneralRe: Dot Net Remoting Pin
PJ_1234517-Oct-07 3:34
PJ_1234517-Oct-07 3:34 
GeneralRe: Dot Net Remoting Pin
PJ_1234517-Oct-07 3:50
PJ_1234517-Oct-07 3:50 
Question2 dimensional array ? Pin
Mr Oizo16-Oct-07 5:41
Mr Oizo16-Oct-07 5:41 
AnswerRe: 2 dimensional array ? Pin
Dave Kreskowiak16-Oct-07 5:48
mveDave Kreskowiak16-Oct-07 5:48 
GeneralRe: 2 dimensional array ? Pin
Mr Oizo16-Oct-07 5:57
Mr Oizo16-Oct-07 5:57 
QuestionVB.net 1.1 logical drives Pin
Gspro200016-Oct-07 5:26
Gspro200016-Oct-07 5:26 
AnswerRe: VB.net 1.1 logical drives Pin
Dave Kreskowiak16-Oct-07 5:43
mveDave Kreskowiak16-Oct-07 5:43 
GeneralRe: VB.net 1.1 logical drives Pin
Gspro200017-Oct-07 13:59
Gspro200017-Oct-07 13:59 
GeneralRe: VB.net 1.1 logical drives Pin
Dave Kreskowiak17-Oct-07 14:04
mveDave Kreskowiak17-Oct-07 14:04 
QuestionhOTEL MANAGEMENT SYSTEM USING VB.NET? Pin
mpisha16-Oct-07 2:56
mpisha16-Oct-07 2:56 
AnswerRe: hOTEL MANAGEMENT SYSTEM USING VB.NET? [modified] Pin
Jonathan [Darka]16-Oct-07 3:20
professionalJonathan [Darka]16-Oct-07 3:20 
GeneralRe: hOTEL MANAGEMENT SYSTEM USING VB.NET? Pin
mpisha18-Oct-07 8:24
mpisha18-Oct-07 8:24 
AnswerRe: hOTEL MANAGEMENT SYSTEM USING VB.NET? Pin
Vimalsoft(Pty) Ltd16-Oct-07 3:34
professionalVimalsoft(Pty) Ltd16-Oct-07 3:34 
GeneralRe: hOTEL MANAGEMENT SYSTEM USING VB.NET? Pin
mpisha18-Oct-07 8:33
mpisha18-Oct-07 8:33 
GeneralRe: hOTEL MANAGEMENT SYSTEM USING VB.NET? Pin
Vimalsoft(Pty) Ltd18-Oct-07 20:04
professionalVimalsoft(Pty) Ltd18-Oct-07 20:04 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.