.NET Framework - "AddressAlreadyInUse" error calling start() on TcpListener...

Asked By Charli
01-Mar-07 08:58 AM
Hi:

I'm creating a simple port listener.  When I call start() method it returns

Int32 port = 80;
IPAddress localAddr = IPAddress.Parse( "127.0.0.1" );
TcpListener server = new TcpListener(port);
server = new TcpListener( localAddr, port );
server.Start();  // Get error here

Thanks,
Charlie
IIS
(1)
IPAddress
(1)
TcpListener
(1)
Int32
(1)
Check
(1)
Parse
(1)
  Ignacio Machin \( .NET/ C# MVP \) replied...
01-Mar-07 10:55 AM
Hi,


Probably you already have another process running in port 80, did you try
another port?

Check if you have IIS running in your computer
  Charli replied...
01-Mar-07 03:04 PM
Thanks Ignacio.  Needed to shut off IIS.
Create New Account
help
Discussions System.ServiceModel.ServiceHost (1) ServiceHostFactory (1) CreateServiceHost (1) WCFExtensionLib (1) ServiceHost (1) WebService (1) IIS 6.0 (1) WCF (1) - -- -- - = _NextPart_0001_3CD949D4 Content-Type: text / plain Content-Transfer-Encoding: 7bit Hi is adding a new service endponit that use https / ssl based address. If hosting in IIS is possible, I recommend you host the https / ssl one in IIS since that can make the SSL / HTTPS configuration much more convenient. Here are some reference about configuring SSL / HTTPS in IIS: http: / / www.petri.co.il / configure_ssl_on_your_website_with_iis.htm http: / / www.microsoft.com / technet / prodtechnol / WindowsServer2003 / Library / IIS / 5 6bdf977-14f8-4867-9c51-34c346d48b04.mspx?mfr = true Sure, https / ssl can be used out of IIS based on the new http.sys component in windows and WCF can also uitlize it is adding a new service endponit that use https / ssl based address. If hosting in IIS is possible, I recommend you host the https / ssl one in IIS since that can make the SSL / HTTPS configuration much more convenient. Here are some reference
Const DIGCF_PROFILE As UInt32 = 8 Const DIGCF_DEVICEINTERFACE As UInt32 = &H10 Structure SP_DEVINFO_DATA Public Size As Int32 Public guid As Guid Public devInst As UInt32 Public Reserved As UIntPtr End Structure Shared IntPtr, _ ByRef deviceInterfaceData As SP_DEVICE_INTERFACE_DATA, _ ByVal deviceInterfaceDetailData As SP_DEVICE_INTERFACE_DETAIL_DATA, _ ByVal deviceInterfaceDetailDataSize As Int32, _ ByRef requiredSize As Int32, _ ByVal deviceInfoData As SP_DEVINFO_DATA) As Boolean Schon der erste Aufruf Dim ptrDeviceHandle As IntPtr Definitionen nach dem letzten Umbau Public Const BUFFER_SIZE As Short = 255 Public Const DIGCF_PRESENT As Int32 = (2) Public Const DIGCF_DEVICEINTERFACE = &H10 Public Const GUID_DEVINTERFACE_DISK = Public Structure SP_DEVINFO_DATA Public cbSize As Int32 Public InterfaceClassGuid As Guid Public Flags As Int32 Public Reserved As IntPtr End Structure Public Structure SP_DEVICE_INTERFACE_DATA Public cbSize As Int32 Public interfaceClassGuid As Guid Public flags As Int32 Private reserved As UIntPtr End Structure Public Structure SP_DEVICE_INTERFACE_DETAIL_DATA Public cbSize As Int32 Public DevicePath
1312 indicate? - - Scott Norberg .NET Web Services Discussions AclTwbZLErSbRuGHT5KaQDRd9osCCA (1) Exchange Server (1) Vista (1) IIS 7.0 (1) IIS (1) WCF (1) Encoding (1) Control (1) - -- -- - = _NextPart_0001_42D7C99D Content-Type: text / plain Content-Transfer-Encoding thread / a6423cfc-5b11-4900- b9bb-e7f4fac940c4 / There are two things you may have a further check: 1. When run the netsh command to register sslcert, have you used elevated token(to 5b11-4900-b9bb-e7f4fac940c4 / \ par \ par There are two things you may have a further check: \ par \ par 1. When run the netsh command to register sslcert, have you used elevated think the problem is still with the certificate. For creating the certificate, if you have IIS installed, you can try using IIS's ssl certificate request wizard to generate a SSL certificate creation request. Then, you can think the problem is still with the certificate. For creating the certificate, if you have IIS installed, you can try using IIS's ssl certificate request wizard to generate a SSL certificate creation request. Then, you can
I hate IIS - "Server Application Unavailable" error message .NET Framework Yes, I wasted the past two days trying Web (1) Virtual Server (1) Linux (1) Vista (1) Framework versions mixup maybe? Did you check the ASP.NET tab page on the site properties and made sure it is set en-us;Q315158 I have no idea where this is. It can be accessed in IIS Manager at the same level as Web Sites and Application Pools. One of the items because when I first installed Win2003 server it had no problems, complaints or warnings installing IIS for me. I've been using IIS to serve web-pages for several years now without a single problem. It seems that 50727 \ CONFIG \ machine.config * ** snip * ** e section. I just want the damn thing to work. IIS is able to run and server ASP pages for several years now. Why is it feature" where Microsoft is protecting me from myself. It's simply hosed. I believe that IIS normally serves ASP pages under an account named IUSR_<machine-name> - Why can't ASPX v2.0.50727> aspnet_regiis.exe -ga FAMILY \ aspxuseraccount Start granting FAMILY \ aspxuseraccount access to the IIS metabase and other directories used by ASP.NET. Finished granting FAMILY \ aspxuseraccount access to the
fails. I already have 2.0 and I have tried uninstalling / reinstalling all .Net frameworks, IIS etc. I have tried installing WCF alone and the process fails too. I am getting WCF software installed on the machine? Clean it out first. Are you installing as admin? Check your machine config or any *.config files to see if it is marked as read people coming across this same problem and many got their problem solved by uninstalling / reinstalling IIS. It did not solve my problem. I have installed .Net 2.0 sp1, sp2 also machine where you can reproduce the problem and I'll bring in Microsoft Support to check that machine for you. - - Regards, Alvin Bruney [MVP ASP.NET] [Shameless Author plug] The O am getting all the errors I listed in my previous post. Someone suggested me to check the write access for machine.config and web.config and both these files have write 04 Success Querying status of a service: iisadmin 2008-05-07 09:21:04 Starting Check the status of IIS 2008-05-07 09:21:04 Success Check the status of IIS 2008-05-07 09:21:04 Starting Querying status of a