Microsoft Windows Vista Community Forums - Vistaheads
Recommended Download



Welcome to the Microsoft Windows Vista Community Forums - Vistaheads, YOUR Largest Resource for Windows Vista related information.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so , join our community today!

If you have any problems with the registration process or your account login, please contact us.

Driver Scanner

Socket problem migrating to Vista

microsoft.public.windows.vista.networking sharing






Speedup My PC
Reply
  #1 (permalink)  
Old 09-24-2007
Valerie Hough
 

Posts: n/a
Socket problem migrating to Vista
My app currently runs C#, .NET v2.0 on Windows Xp/Windows Server 2003, using
asynchronous socket communication.

I set up my server socket:

Socket s = new Socket( AddressFamily.InterNetwork, SocketType.Stream,
ProtocolType.Tcp );
IPEndPoint ep = new IPEndPoint( IPAddress.Any, 0 );
s.Bind( ep );
int port = ep.Port;

The server socket's computer name and port number get stored in a SQL
database and new clients retrieve them to connect as follows:

Socket sClient = new Socket( AddressFamily.InterNetwork, SocketType.Stream,
ProtocolType.Tcp );
IPAddress ipAddress = Dns.GetHostEntry( computerName, port ).AddressList[0];
IPEndPoint ep = new IPEndPoint( ipAddress, port );
sClient.Bind( ep );

When I run the server socket application on the Vista machine and the client
socket application from the XP machine everything works fine.
When I run the server socket application on the XP machine and the client
socket application from the Vista machine everything works fine.

However, when I run both applications from Vista machines, the server socket
gets set up, but when my client tries to connect, I get the following
exception:

Error message: An address incompatible with the requested protocol was used

at System.Net.Sockets.Socket.DoBeginConnect( EndPoint endPointShapshot,
SocketAddress socketAddress, LazyAsyncResult asyncResult )
at System.Net.Sockets.Socket.BeginConnect( EndPoint remoteEP,
AsyncCallback callback, Object state )
at MySocketClass.Sockets.Connect()

My googling suggests that the problem stems from Vista by default using
IPv6 socket and the way I have my client socket created resulting in IPv4.

Is there a solution which will work correctly in all three of these
scenarios without switching versions of .NET ?

Thanks in advance,
Chris Hough


Reply With Quote
Sponsored Links
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Socket problem migrating to Vista Valerie Hough microsoft.public.windows.vista.general 3 09-25-2007 00:21
WSAENETDOWN on socket() call on Vista Erik microsoft.public.windows.vista.networking sharing 0 07-17-2007 22:52
Vista on socket A motherboard Lee M. microsoft.public.windows.vista.general 8 06-12-2007 09:59
Migrating Your Data From XP To Vista =?Utf-8?B?YXdvbGZl?= microsoft.public.windows.vista.general 1 02-28-2007 23:28
Migrating Your Data From XP To Vista =?Utf-8?B?YXdvbGZl?= microsoft.public.windows.vista.installation setup 1 01-13-2007 23:25




All times are GMT +1. The time now is 05:35.




Driver Scanner - Free Scan Now

Vistaheads.com is part of the Heads Network. See also XPHeads.com , Win7Heads.com and Win8Heads.com.


Design by Vjacheslav Trushkin for phpBBStyles.com.
Powered by vBulletin® Version 3.6.7
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.6.0 RC 2

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120