Science, Technology & Health: April 2006 Archives
I found an interesting anomaly yesterday while debugging a .NET System.Net.Sockets.Socket problem. I'm using the asynchronous socket methods, which is probably a mistake. In hindsight, I would have been better off just spawning a couple of threads and using the synchronous methods.
After making the connection between my listening and connecting socket objects, I call BeginReceive on both ends and and pass in my callbacks, named OnReceivedData. (This callback is supposed to get called when there's incoming data on the socket.)
The anomaly is that the connecting socket's OnReceivedData callback is being invoked even when no data is sent by the listening socket. OnReceivedData is (improperly) invoked one single time exactly one second after the connection is made. When EndReceive is called during to this invokation of OnReceivedData by the connecting socket, an exception is thrown, probably because the socket isn't in the right state for EndReceive to work properly. (If EndReceive is called and there is no data, one would expect the method to simply return 0 bytes, not throw an exception.) If this exception is ignored, OnReceivedData isn't invoked improperly again and everything proceeds as would be expected.
If the listening socket sends a single byte within this first one-second window, OnReceivedData is invoked by the connecting socket (properly) and EndReceive is called and completes (as expected) without an exception. The connection then functions normally.
It doesn't seem like it should be necessary for the listening socket to send data to the connecting socket; the listening socket doesn't improperly invoke its callback if it doesn't receive data. Once the connection is established, there's no reason the listening socket and the connecting socket should behave differently. Seeing as how this behavior is not documented, I think it's a bug. I haven't attemped to recreate it yet in Mono on any platform.
When it comes to national defense, appearance is almost everything, as both the US and the USSR learned and practiced throughout the Cold War. President Reagan's "Star Wars" space laser program was never intended to be fielded, but the threat was instrumental in bringing the Soviets to their knees. Similarly, when American scientists entered the former USSR to help decommission nuclear missiles under the various disarmament treaties they discovered that as little as 50% of the Soviet missile fleet was armed with warheads, and even less than that was capable of successful launch, flight, and detonation. Both nations intentionally spent hoards of money on weapons systems that were more for show than for use -- and that strategy was highly classified at the time and known to very few.
I'm reminded of this history when I read about alleged fraud in our missile interceptor program. I don't have any first-hand knowledge of the program, but I know how the defense industry works. Classified programs are highly compartmentalized, with lines drawn based on the infamous "need to know", or NTK. If the team working on part A doesn't need to know how part B works, they won't, and they might not even know that part B exists. Even though each team working on the antimissile program believes that the program is real and that the component they're responsible for will work, it's entirely plausible that the whole program is nothing more than a show for the benefit of our enemies who may otherwise think they have a chance to nuke us with ICBMs.
A senior Congressional investigator has accused his agency of covering up a scientific fraud among builders of a $26 billion system meant to shield the nation from nuclear attack. The disputed weapon is the centerpiece of the Bush administration's antimissile plan, which is expected to cost more than $250 billion over the next two decades.The investigator, Subrata Ghoshroy of the Government Accountability Office, led technical analyses of a prototype warhead for the antimissile weapon in an 18-month study, winning awards for his "great care" and "tremendous skill and patience."
Mr. Ghoshroy now says his agency ignored evidence that the two main contractors had doctored data, skewed test results and made false statements in a 2002 report that credited the contractors with revealing the warhead's failings to the government.
Despite being well-intentioned, "whistle-blowers" like Subrata Ghoshroy may be undermining an expensive and critical deception on the part of our government, and thereby undermining our national security.






