Re: New constructor for TCPListener



Hello,

if you use IPAddress.Any, it will bind to all available addresses on the machine.

Kind regards,
Henning Krause

"Jon Jacobs" <JonJacobs@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message news:62D8284A-4B37-4FAB-AEF7-AE3A552AFD1B@xxxxxxxxxxxxxxxx
I use in vb (VS2005)

Server = New TcpListener(PortNumber)

Which is simple and straightforward. But I get
Public Sub New(port As Integer) is obsolete: This method has been
deprecated. Please use TcpListener(IPAddress localaddr, int port) instead.

It also gives a link that returns "page not found."

If I use the new constructor, what values do I give it so that it behaves
the same as the old constructor?
I guess the port number would be the same, but what in the world should I
put as the IPAddress?

The scenario is this: First I deploy the app as a service on my development
machine and put the TCP communications through its paces, from apps on my
machine and other machines.
Next I uninstall it from my machine and install it on a test server, and put
it through the same tests.
Finally, I uninstall it from the test server and install it on the
production server. etc.

This should all work without changing any code in the program or the
contents of any files it reads, and without recompiling the program.

I can do this with the "obsolete" constructor. What do I use for IPAddress
so it works the same way with the new constructor?

.



Relevant Pages

  • Error installing KB960082 on SBS 2003 R2 Std
    ... The other day I installed Tuesday's patches on my test server. ... I noticed there were two updates for 960082; one for SQL Server and one for Server 2003. ... I noticed Windows Update said there were no updates left to install. ...
    (microsoft.public.windows.server.sbs)
  • Re: Dynamically Change URL of web service
    ... want - this initialization only happens in the constructor. ... Microsoft MVP - Windows Client ... When I updated the URL to server A, yes, the code did not ... >>>> client apps will use the exact same web service, ...
    (microsoft.public.dotnet.framework.windowsforms)
  • Re: The server is not operational
    ... probably the exact same credentials you need to use in your DirectoryEntry ... specifying "AuthenticationTypes.Secure" in your DE constructor. ... I din't specify SSL or Connectionless, ... my web server is in dmz and I can't see user list ...
    (microsoft.public.dotnet.framework.aspnet.security)
  • Re: Reflection problem
    ... > I'm trying to write an application which communicates with a remote ... Normally an applet is loaded from the server system which ... > application rather than an applet. ... It then calls the constructor: ...
    (comp.lang.java.programmer)
  • Re: Remote object with arguments?
    ... marshalling myself using the RemotingServices.Marshal command, ... Server-activated objects require a default constructor. ... "Server Activation" ... "Client Activation" ...
    (microsoft.public.dotnet.languages.csharp)

Loading