Help me! How to declare a TCPChannel Object

R

Risen

Hi,all,

How to declare a TCPChannel Object and implement it? In MSDN I found code
and try it In IDE,but it have some error,so can not compile it!

Imports System
Imports System.Runtime.Remoting
Imports System.Runtime.Remoting.Channels
Imports System.Runtime.Remoting.Channels.TCP -> error! IDE report not found
this namespace or type £¿£¿

Namespace RemotingSamples
Public Class Sample
Shared Sub Main
Dim chan As TCPChannel -> error! IDE report not defined type!!
chan = New TCPChannel(8085)
ChannelServices.RegisterChannel(chan)
RemotingConfiguration.RegisterWellKnownServiceType( _
Type.GetType("RemotingSamples.HelloServer, object"), _
"SayHello", WellKnownObjectMode.SingleCall)
System.Console.WriteLine("Hit to exit...")
System.Console.ReadLine()
End Sub
End Class
End Namespace

now,what can I do for it? How to ues the TCPChannel Object? Thanks a lot!!
 
H

Herfried K. Wagner [MVP]

Risen said:
How to declare a TCPChannel Object and implement it? In MSDN I found code
and try it In IDE,but it have some error,so can not compile it!

Imports System
Imports System.Runtime.Remoting
Imports System.Runtime.Remoting.Channels
Imports System.Runtime.Remoting.Channels.TCP -> error! IDE report not
found
this namespace or type £¿£¿

Make sure your project contains a reference to
"System.Runtime.Remoting.dll". You can add a reference by selecting the
project in the solution explorer, choosing "Add reference..." from its
context menu, and selecting "System.Runtime.Remoting.dll" from the ".NET"
tab.
 
R

Risen

Thanks!


Herfried K. Wagner said:
Make sure your project contains a reference to
"System.Runtime.Remoting.dll". You can add a reference by selecting the
project in the solution explorer, choosing "Add reference..." from its
context menu, and selecting "System.Runtime.Remoting.dll" from the ".NET"
tab.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top