473,698 Members | 2,576 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

vista server not accepting connetions

Bob
Hi,
I have some code that sets up an asynchronous server. It is working
fine on my XP machines but I can't get it to work on Vista.
Actually, it "works: in that it runs but when I try to connect via
telnet I get nothing. I have tried opening up the port and also
turned off the firewall. Neither seems to work and it won't accept
conections. Does anyone know of anything else I should do?

Thanks,,
Bob

IPHostEntry localMachineInf o =
Dns.GetHostEntr y(Dns.GetHostNa me());
IPEndPoint myEndpoint = new IPEndPoint(
localMachineInf o.AddressList[0], _port);

// Create the socket, bind it, and start listening
_serverSocket = new
Socket(myEndpoi nt.Address.Addr essFamily,
SocketType.Stre am, ProtocolType.Tc p);
_serverSocket.B ind(myEndpoint) ;

_serverSocket.L isten((int)Sock etOptionName.Ma xConnections);

May 1 '07 #1
5 1312
Hi

Under what user your vista code runs?
I think it's a Vista related problem, so you are going to be better anwered
in a Vista's NG

"Bob" <bs********@yah oo.comwrote in message
news:11******** **************@ y5g2000hsa.goog legroups.com...
Hi,
I have some code that sets up an asynchronous server. It is working
fine on my XP machines but I can't get it to work on Vista.
Actually, it "works: in that it runs but when I try to connect via
telnet I get nothing. I have tried opening up the port and also
turned off the firewall. Neither seems to work and it won't accept
conections. Does anyone know of anything else I should do?

Thanks,,
Bob

IPHostEntry localMachineInf o =
Dns.GetHostEntr y(Dns.GetHostNa me());
IPEndPoint myEndpoint = new IPEndPoint(
localMachineInf o.AddressList[0], _port);

// Create the socket, bind it, and start listening
_serverSocket = new
Socket(myEndpoi nt.Address.Addr essFamily,
SocketType.Stre am, ProtocolType.Tc p);
_serverSocket.B ind(myEndpoint) ;

_serverSocket.L isten((int)Sock etOptionName.Ma xConnections);

May 1 '07 #2
Bob
On May 1, 12:44 pm, "Ignacio Machin \( .NET/ C# MVP \)" <machin TA
laceupsolutions .comwrote:
Hi

Under what user your vista code runs?
I think it's a Vista related problem, so you are going to be better anwered
in a Vista's NG

"Bob" <bshumsk...@yah oo.comwrote in message

news:11******** **************@ y5g2000hsa.goog legroups.com...
Hi,
I have some code that sets up an asynchronous server. It is working
fine on my XP machines but I can't get it to work on Vista.
Actually, it "works: in that it runs but when I try to connect via
telnet I get nothing. I have tried opening up the port and also
turned off the firewall. Neither seems to work and it won't accept
conections. Does anyone know of anything else I should do?
Thanks,,
Bob
IPHostEntry localMachineInf o =
Dns.GetHostEntr y(Dns.GetHostNa me());
IPEndPoint myEndpoint = new IPEndPoint(
localMachineInf o.AddressList[0], _port);
// Create the socket, bind it, and start listening
_serverSocket = new
Socket(myEndpoi nt.Address.Addr essFamily,
SocketType.Stre am, ProtocolType.Tc p);
_serverSocket.B ind(myEndpoint) ;
_serverSocket.L isten((int)Sock etOptionName.Ma xConnections);
Good point. I have tried both an administrator user and a standard
user.

May 1 '07 #3
Bob
On May 1, 6:34 pm, Bob <bshumsk...@yah oo.comwrote:
On May 1, 12:44 pm, "Ignacio Machin \( .NET/ C# MVP \)" <machin TA

laceupsolutions .comwrote:
Hi
Under what user your vista code runs?
I think it's a Vista related problem, so you are going to be better anwered
in a Vista's NG
"Bob" <bshumsk...@yah oo.comwrote in message
news:11******** **************@ y5g2000hsa.goog legroups.com...
Hi,
I have some code that sets up an asynchronous server. It is working
fine on my XP machines but I can't get it to work on Vista.
Actually, it "works: in that it runs but when I try to connect via
telnet I get nothing. I have tried opening up the port and also
turned off the firewall. Neither seems to work and it won't accept
conections. Does anyone know of anything else I should do?
Thanks,,
Bob
IPHostEntry localMachineInf o =
Dns.GetHostEntr y(Dns.GetHostNa me());
IPEndPoint myEndpoint = new IPEndPoint(
localMachineInf o.AddressList[0], _port);
// Create the socket, bind it, and start listening
_serverSocket = new
Socket(myEndpoi nt.Address.Addr essFamily,
SocketType.Stre am, ProtocolType.Tc p);
_serverSocket.B ind(myEndpoint) ;
_serverSocket.L isten((int)Sock etOptionName.Ma xConnections);

Good point. I have tried both an administrator user and a standard
user.
I think I figured out the problem. I think has to do with Vista
implementing ipv6 addresses. I was using the following code:

IPHostEntry localMachineInf o =
Dns.GetHostEntr y(Dns.GetHostNa me());
IPEndPoint myEndpoint = new IPEndPoint(
localMachineInf o.AddressList[0], _port);

however, the localMachineInf o.AddressList on my vista computer had a
length of 3 compared to 1 on my XP machines. The address that I was
trying to connect to (the old ipv4 version like 192.168.1.1) is the
last entry on vista. Accordingly, when I modify the code to:

IPEndPoint myEndpoint = new IPEndPoint(

localMachineInf o.AddressList[localMachineInf o.AddressList.L ength-1],
_port);

it seems to work.

Thanks,
Bob

May 2 '07 #4
"Bob" <bs********@yah oo.comwrote in message
news:11******** **************@ h2g2000hsg.goog legroups.com...
On May 1, 6:34 pm, Bob <bshumsk...@yah oo.comwrote:
>On May 1, 12:44 pm, "Ignacio Machin \( .NET/ C# MVP \)" <machin TA

laceupsolution s.comwrote:
Hi
Under what user your vista code runs?
I think it's a Vista related problem, so you are going to be better
anwered
in a Vista's NG
"Bob" <bshumsk...@yah oo.comwrote in message
>news:11******* *************** @y5g2000hsa.goo glegroups.com.. .
Hi,
I have some code that sets up an asynchronous server. It is working
fine on my XP machines but I can't get it to work on Vista.
Actually, it "works: in that it runs but when I try to connect via
telnet I get nothing. I have tried opening up the port and also
turned off the firewall. Neither seems to work and it won't accept
conections. Does anyone know of anything else I should do?
Thanks,,
Bob
IPHostEntry localMachineInf o =
Dns.GetHostEntr y(Dns.GetHostNa me());
IPEndPoint myEndpoint = new IPEndPoint(
localMachineInf o.AddressList[0], _port);
// Create the socket, bind it, and start listening
_serverSocket = new
Socket(myEndpoi nt.Address.Addr essFamily,
SocketType.Stre am, ProtocolType.Tc p);
_serverSocket.B ind(myEndpoint) ;
_serverSocket.L isten((int)Sock etOptionName.Ma xConnections);

Good point. I have tried both an administrator user and a standard
user.

I think I figured out the problem. I think has to do with Vista
implementing ipv6 addresses. I was using the following code:

IPHostEntry localMachineInf o =
Dns.GetHostEntr y(Dns.GetHostNa me());
IPEndPoint myEndpoint = new IPEndPoint(
localMachineInf o.AddressList[0], _port);

however, the localMachineInf o.AddressList on my vista computer had a
length of 3 compared to 1 on my XP machines. The address that I was
trying to connect to (the old ipv4 version like 192.168.1.1) is the
last entry on vista. Accordingly, when I modify the code to:

IPEndPoint myEndpoint = new IPEndPoint(

localMachineInf o.AddressList[localMachineInf o.AddressList.L ength-1],
_port);

it seems to work.

Thanks,
Bob


There is no guranatee that the IPV4 entry is at a fixed position in the
list, so this is bound to fail. You have to enumerate the list and check the
address family you want your endpoint to bind to.
Something like this will do:

IPHostEntry localMachineInf o Dns.GetHostEntr y(Dns.GetHostNa me());
foreach (IPAddress ip in localMachineInf o .AddressList)
{
if((int)ip.Addr essFamily == (int)ProtocolFa mily.InterNetwo rk)
{
IPEndPoint myEndpoint = new IPEndPoint(ip, _port);
.....
Willy.

May 2 '07 #5
Bob
Awesome, thanks!
Willy Denoyette [MVP] wrote:
"Bob" <bs********@yah oo.comwrote in message
news:11******** **************@ h2g2000hsg.goog legroups.com...
On May 1, 6:34 pm, Bob <bshumsk...@yah oo.comwrote:
On May 1, 12:44 pm, "Ignacio Machin \( .NET/ C# MVP \)" <machin TA

laceupsolutions .comwrote:
Hi

Under what user your vista code runs?
I think it's a Vista related problem, so you are going to be better
anwered
in a Vista's NG

"Bob" <bshumsk...@yah oo.comwrote in message

news:11******** **************@ y5g2000hsa.goog legroups.com...

Hi,
I have some code that sets up an asynchronous server. It is working
fine on my XP machines but I can't get it to work on Vista.
Actually, it "works: in that it runs but when I try to connect via
telnet I get nothing. I have tried opening up the port and also
turned off the firewall. Neither seems to work and it won't accept
conections. Does anyone know of anything else I should do?

Thanks,,
Bob

IPHostEntry localMachineInf o =
Dns.GetHostEntr y(Dns.GetHostNa me());
IPEndPoint myEndpoint = new IPEndPoint(
localMachineInf o.AddressList[0], _port);

// Create the socket, bind it, and start listening
_serverSocket = new
Socket(myEndpoi nt.Address.Addr essFamily,
SocketType.Stre am, ProtocolType.Tc p);
_serverSocket.B ind(myEndpoint) ;

_serverSocket.L isten((int)Sock etOptionName.Ma xConnections);

Good point. I have tried both an administrator user and a standard
user.
I think I figured out the problem. I think has to do with Vista
implementing ipv6 addresses. I was using the following code:

IPHostEntry localMachineInf o =
Dns.GetHostEntr y(Dns.GetHostNa me());
IPEndPoint myEndpoint = new IPEndPoint(
localMachineInf o.AddressList[0], _port);

however, the localMachineInf o.AddressList on my vista computer had a
length of 3 compared to 1 on my XP machines. The address that I was
trying to connect to (the old ipv4 version like 192.168.1.1) is the
last entry on vista. Accordingly, when I modify the code to:

IPEndPoint myEndpoint = new IPEndPoint(

localMachineInf o.AddressList[localMachineInf o.AddressList.L ength-1],
_port);

it seems to work.

Thanks,
Bob

There is no guranatee that the IPV4 entry is at a fixed position in the
list, so this is bound to fail. You have to enumerate the list and check the
address family you want your endpoint to bind to.
Something like this will do:

IPHostEntry localMachineInf o Dns.GetHostEntr y(Dns.GetHostNa me());
foreach (IPAddress ip in localMachineInf o .AddressList)
{
if((int)ip.Addr essFamily == (int)ProtocolFa mily.InterNetwo rk)
{
IPEndPoint myEndpoint = new IPEndPoint(ip, _port);
.....
Willy.
May 2 '07 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

13
3024
by: Mark Rae | last post by:
Hi, On Friday I attended the Microsoft EVO conference in London where they talked about Vista, Office 2007 and Exchange 2007 and how they all work together beautifully, how they were all "people-ready" etc... I asked a couple of questions about Visual Studio.NET on Vista, especially on 64-bit Vista, and they became *very* nervous... To cut a long story short, Microsoft will not support ANY version of Visual
56
3621
by: Squishy | last post by:
I tried installing my VS2005 Pro on Vista Ultimate 32 bit RTM today and got errors stating that VS2005 was not compatible with Vista. Microsoft......please pull your finger out of my ass and tell me this is a joke. It must be a joke....because I also have read that VS2002 and VS2003 will not be supported on Vista. This clearly violates Microsoft's own terms of support for these products.
6
4275
by: j2ee.singh | last post by:
Hi, I'm looking to buy a new laptop primarily to learn & practice .NET and C#. My Question is: Is there any requirement for .NET and C# in terms of the following Operating Systems: - Windows Vista Home Basic - Windows Vista Business
6
4497
by: theintrepidfox | last post by:
Dear Group I've installed MSSQL 2005 STD on Vista and now can't attach my databases. I've installed SQL SP2 and the SQL Vista Beta Update. The error I'm getting is: Unable to open the physical file <Path to MDF>. Operating system error 5: '''5(Error not found)'''. (Microsoft SQL Server, Error: 5120)
18
2699
by: =?Utf-8?B?Tm9ybUQ=?= | last post by:
I have created a three tier application consisting of Client (Exe and Exe.Config), Middle (WebServices) and Database tiers. The Client tier contains an Exe, an Exe.Config and a dynamic Web reference. The Exe reads a key-value pair from the Exe.Config file, which is a link to the appropriate WebService that it should connect to, and sets the dynamic Web reference’s URL. If the Exe.Config file does not contain the key-value or if the...
6
1964
by: John Kotuby | last post by:
Hi all... Well my earlier post aboout not being able to access http://localhost has been resolved. I am still having problems testing my Web site project. First, thanks to Juan Libre I edited my HOSTS file and can access localhost. However, what I found in the HOSTS file was not what I expected. Juan mentioned that the following line might be missing. 127.0.0.1 localhost
11
2134
by: =?Utf-8?B?VG9tIE5vd2Fr?= | last post by:
I wanted to know if Windows Vista Home Premium edition comes with some sort of web server, so I can continue to do web development using Visual Studio 2005.
5
2672
by: =?Utf-8?B?bXVzb3NkZXY=?= | last post by:
Hi, I wonder if someone could shed some light on this one for me. I have developed a web app in VS2005 with the built in server. It uses an sql database, everytihng works. I need to test it across the network, so i've installed IIS7 on my Vista machine and created a new website, point at the website's directory. After I switched to the 'Classic .net' app pool, it shows up on the port.
1
3407
by: premMS143 | last post by:
Hi, I Installed ASTON software to my Windows Vista OS. After instaling i asked for log off & then restarted the system. After restarting I got only Windows logon screen. But after accepting my administrator password, its showing an error message box saying "ordinal 123 could not be located in dynamic link library (Shell32.dll)". This msgbox having single OK button to accept. Clicking on OK button, blackens the entire screen.
0
8609
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9169
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8899
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8871
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
5861
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4371
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4622
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3052
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2007
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.