.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
david stephan
Gaurav Pal
Post New Web Links

Windows 7 socket bind behavior difference from XP/Server 2003, with reuse address socket option (WSA

Posted By:      Posted Date: September 22, 2010    Points: 0   Category :.NET Framework

I have two processes that are both listening to UDP packets and can run on the same PC.  One process binds a socket to one NIC address with port 18246.  The other process has two Socket objects, one for sending on port 18246 and one for listening on port 18246.  Both of these sockets are created, have the SO_REUSEADDR socket option set.  Bind is called for a single IP Endpoint for a common local NIC address, but a different one than used by the above app.

Under Windows XP and server 2003, both processes can bind regardless of order of startup.

Under Windows 7, if the process with only one socket starts first, the second process fails with WSAEACCES 10013 error with the second socket bind.

I wrote a sample C# app with the following method that fails when running under Windows 7 x86 and x64.  The above failure occurs when the sockets are in separate processes, but a single process using the same socket interaction also fails.  The below method is called with two IPV4 addresses that are assigned to local Network adapters on the PC.

View Complete Post

More Related Resource Links

How to setup windows server 2008 to enable socket communication?

I wrote a simple socket program, which listens to the 82 port, then receives and sends data through it. I tested the program on my local machine and it works fine, but after I published the program onto my windows server 2008, it does not work anymore. I guess it should be the firewall causing the problem, so I added rules to allow 82 port for both in and out bound, and I also add my application to the allowed program list for passing firewall, but still doesn't work, how could I solve it?   The windows server 2008 machine has a public network IP address, while my workstation is in a local network without public IP address, I connect to server 2008 through a router which has a public IP address. Is that the problem?   thanks! Regards! directfriends.net

Windows Server 2003: Discover Improved System Info, New Kernel, Debugging, Security, and UI APIs


There's a lot to say about Windows Server 2003. First of all, it's the first operating system with built-in .NET Framework support, and it's the first 64-bit OS from Microsoft. But wait, there's more! There are lots of new features and APIs in this version as well. For instance, Windows Server 2003 features Hot Add Memory and a number of other arcane new tidbits. There are new APIs for handling threads, directories, and files, and new features like the low fragmentation heap for managing memory and system information. There's vectored exception handling and new UI APIs as well.OS internals expert Matt Pietrek takes a look at the additions he finds most interesting and useful so you'll have a good place to start when you dive into Windows Server 2003.

Matt Pietrek

MSDN Magazine June 2003

Security Briefs: Exploring S4U Kerberos Extensions in Windows Server 2003


Building Web sites that provide services external to the corporate firewall is tricky. Usually it's not desirable to grant corporate domain accounts to external clients, and from a purely practical standpoint Kerberos does not work well over the Internet due to the typical configuration of client-side firewalls.

Keith Brown

MSDN Magazine April 2003

Windows UDP Socket Buffer (Maximum)

I am receiving on a socket (C#) and setting the UDP buffer size to br 10 Mb - and creating 16 such sockets. But I see missed UDP packets (they have  a unique seq number in them). When I read back "ReceiveBufferSize" it return the size I set it to - 10Mb.   My question is - what is the maximum internal socket buffer size allowed by Windows (Win Server 2008) ?   Wierdly when I also start Netmon in the background on the receiving machine - I do not see any missed packets.   Does Netmon modify internal windows socket buffers (increase them) - how can I go about doing this with my app ?   Thanks

SQL express 2008 r2 on windows server 2003

install ends with the following error : "MsiEnumRelatedProducts failed to enumerate products with UpgradeCode='{1B117BA7-5BC1-419E-820E-7D4F3F412C7B}'. Error code: 1610."

Does SQL 2005 Enterprise Edition come preloaded on Windows Server 2003 Virtual Server.

Does SQL 2005 Enterprise Edition come preloaded on  Windows Server 2003 Virtual Server. I found this link http://www.microsoft.com/downloads/details.aspx?FamilyID=77f24c9d-b4b8-4f73-99e3-c66f80e415b6&displaylang=enMr Shaw

Can't bind a UDP socket to a port

using System; using System.Net; using System.Net.Sockets; using System.Text; namespace ConsoleApplication1 { class Program { static void Main(string[] args) { int port = 11000; Socket socket = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp); IPEndPoint ipendpoint = new IPEndPoint(IPAddress.Any, port); try { socket.Bind(ipendpoint); Console.WriteLine("Successfully bound to port " + port); } catch (SocketException e) { Console.WriteLine("Winsock error: " + e.ErrorCode.ToString() + ", " + e.Message.ToString()); } Console.Read(); } } } I get the error code [b]10022[/b] when trying to bind the UDP socket, which is "Invalid argument specified". This is the same for all the UDP server examples on the internet at the binding stage, as well as the MSDN one. It will work if the port is 0, but not if the port is anything but 0. TCP binding works fine, and I can make a UDP server on any port with Java (the binding works fine) but in C# it gives me this error. The code works for everyone I've asked to try it, and I've got the latest NET framework (version 4) and Windows XP with SP3 so I know the commands are supported by the OS (also, Visual C# 2010 Express and 2008 Express both give this error). Any ideas to fix it?

How should I configure Asp.NET on IIS 6, Sql Server 2005 and SSRS 2005 across 2 Windows Server 2003

I was running a MIS reporting solution on a single server running MS Windows 2003 Server and Sql Server 2005. The solution was built using ASP.NET 2.0 on IIS 6.0, Sql Server DB & SSRS. I now have purchased a 2nd server running MS Windows 2003 Server and Sql Server 2005. What is the best configuration to split the following application components across the 2 physical servers? ASP.NET web application SQL Server 2005 Datawarehouse SSRS Web Applications (Reports & ReportServer) SSRS Databases (ReportServer & ReportServerTempDB) The hardware configuration of the 2 servers are as follows Server 1 MS Windows Server 2003 Enterprise Edition SP2 Intel(R) Xeon(R) CPU 5150 @2.66GHz 16 GB RAM Sql Server 2005 SP3 Standard Edition Smart Array P400 in Slot 1 (SAS Array A with Spare / SAS Array B with Spare) Drive C: 68.33 GB | Drive D: 273.40 GB Server 2 MS Windows Server 2003 Standard Edition SP2 Intel(R) Xeon(R) CPU X5570 @2.93GHz 4 GB RAM Sql Server 2005 SP3 Standard Edition IBM ServeRAID-MR10i SAS/SATA Controller Drive C: 135GB | Drive D: 556 GB | Drive E: 271 GB Any suggestions would be of great help

SQL-Server 2005 x64 / windows server 2003 x64 crashes during file copy

Hi We are running: Microsoft SQL Server 2005 Standard - 9.00.4294.00 (X64) Microsoft Windows Server 2003 R2 Enterprise x64 We have gigabit interface. Today we copied a file (using robocopy) from our databaseserver to another server (backup-server). The copy was started from the backup-server and source were specified using UNC. The copy were using about 20% of the bandwith (about 200Mbit). During the copy, sql-server reported several errors, for example: AppDomain 15 (mp.dbo[runtime].14) is marked for unload due to memory pressure. The client was unable to reuse a session with SPID 75, which had been reset for connection pooling. This error may have been caused by an earlier operation failing. Check the error logs for failed operations immediately before this error message. ***Stack Dump being sent to [PATH\SQLDump0005.txt Resource Monitor (0x1384) Worker 0x000000008000C1C0 appears to be non-yielding on Node 0. Memory freed: 0 KB. Approx CPU Used: kernel 15 ms, user 218 ms, Interval: 428541. So to me it appears that sql-server crashed during a file copy. We have 27 GB ram. With 24.5 GB dedicated to SQL-Server. The files we copied were quite large, some over 50GB. I found a similar issue about this: http://support.microsoft.com/kb/920739/ Do you think the issue above could be the cause of the sql-server crash? ///Patrik

Sharepoint 2003 + Windows Terminal Server 2008 + Office 2007 problem?

Hi, We have a customer where some users runs Windows Terminal Server 2008 with Office 2007. They open documents from a Sharepoint 2003 site. When they open an excel sheet they get a button in the document which says "Server workbook: Click edit workbook to edit this workbook" and there is a button: "edit workbook" The users clicks "edit workbook" but get an error message saying there is no connection to the server.  They are able to edit the document, but not save it back to the sharepoint site. Most other users work on their local computer with Office 2003. Here, everything works fine and there are no button/message stating its a server workbook.   Is this caused due to some compatability issues between Sharepoint 2003 and Office 2007?   Best regards, Thomas Hansen ErgoGroup AS

Problem facing in Deployment on Windows Server 2003

Hi All I have deployed my MVC 2 apllication on Windows server 2003 under iis 6.0. I am using Nhibernate for data access. I could deployed it but when i browse the application it is redirecting to Error.aspx Page. It is not showing any stack trace. Can anyone guide me why it is happening. Thanks sskulkarni.

How to access RAM above 32gb on Windows 2003 Server Standard x64?

My employers went and maxed out their database server for RAM to 64gb from 32gb. It's running SQL Server 2005 x64 on Windows 2003 Server Standard x64. As far as i'm aware of, 32gb is the RAM limit for the OS but does sql server have the ability to see beyond this limit? I'm about to ship the RAM back... Any insights would be greatly appreciated!

Install MOSS 2007 and ProClartity 6.3 (PAS6.3) on the same Microsoft Windows 2003 Server

An install of MOSS 2007 and ProClartity 6.3 (PAS6.3) on the same Microsoft Windows 2003 Server seems to be problematic. MOSS 2007 creates a default website and stops the normal default website. As soon as PAS 6.3 is installed it installs to this stopped default website. How can I overcome this issue?

Copy files through batch program on Windows Server 2003

I have a VB6 program running on windows server 2003. When I try to open a file in a SharePoint Document library it will not traverse folders. If I run the application on Windows 7 (maybe Vista too), it can. I assume that there is some operating system helping hand here. In order to get around this problem, we have to output our files to a network share and then copy the files over to the document library manually. My question is, how can I write a batch program that will copy all of the files on a network share to the document library using the individual's credentials? I am unable to map a drive letter to a document library in Windows server 2003 (it works on 7). Any suggestions and tips would be much appreciated. Thanks.

NLB over windows server 2003 Cluster on the same machine group

Hi Guys, I should install MS SQL 2005 cluster on windows server 2003. There will be 2 servers in the group. Meanwhile i should set up load balancing for web application again there will be 2 servers in the group. My question is the following, as the load of the servers aren't high is it acceptable to setup load balancing and clustering service onto same windows server 2003 machines group. i.e. the same 2 servers will be a member of Load Balancing and MS SQL Clustering groups?   pls advise. thx

SQL Server 2008 R2 64 bit Installation on Windows 2003 64 Bit SP2---Installatio help..

Hi all I have SQLServer 2008 r2 binaries copied in my Server and I have do side by side installation. Server already has SQL Server 2000 64 bit on Windows 2003 64 bit SP2. Now  I have to install  SQL Server 2008 64 bit (Side by Side.). Is it ok...if I click on setup.exe it will take care of  Installation of 64 bit or I need to specify any thing to install 64 bit SQL Server 2008. Please guide me with link or advise me where I have take care while installation going on to install 64 bit SQL Server 2008 R2. Thanks in advance.  SNIVAS

MOSS 2007 to SharePoint Server 2010 Hybrid Upgrade Approach on Windows Server 2003 x64

There's some guidance circulating about upgrading to 2010 with a mix of In-Place and Database Attach upgrade methods. My Central Admin and SharePoint Web App are on a 64 bit server, but it's running on Windows server 2003 x64 and not on Windows Server 2008 or 2008 R2. SharePoint Team Blog says Server 2008 or 2008 R2 is required for SP2010. If I want to do the hybrid upgrade approach, is it possible to first upgrade the OS to Server 2008 R2 on the server where my Central Admin and SP Web App runs?  Or will this break MOSS 2007?
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend