Imports System.Runtime.Remoting

Public Class NetRemoting
    Shared Sub IniciaServicioNR(Puerto As Integer, Nombre As String, tipo As Type)
        Dim ht As New Hashtable
        ht("port") = Puerto
        ht("name") = Nombre
        Dim serverProvTcp As New System.Runtime.Remoting.Channels.BinaryServerFormatterSinkProvider
        serverProvTcp.TypeFilterLevel = Runtime.Serialization.Formatters.TypeFilterLevel.Full
        Dim clientProvTcp As New System.Runtime.Remoting.Channels.BinaryClientFormatterSinkProvider
        Dim tc As System.Runtime.Remoting.Channels.Tcp.TcpChannel = New System.Runtime.Remoting.Channels.Tcp.TcpChannel(ht, clientProvTcp, serverProvTcp)
        System.Runtime.Remoting.RemotingConfiguration.RegisterWellKnownServiceType(tipo, Nombre & ".soap", WellKnownObjectMode.Singleton)
    End Sub

End Class
