General things to take into consideration while doing socket programming.

  I had to recently write a client-server socket application and so I was mulling over all that needs to be considered when programming with sockets especially using TCP. I have summarized them below.   1. Partial Packets – Never assume that how much ever you send from one side will be received at the…


Socket Duplication – Part 2

Is it possible to transfer sockets from unmanaged processes? So, a question now arises.. Is it possible to transfer sockets from unmanaged processes to managed processes? The answer is yes.  Isn’t that cool? There are a lot of applications around that have a set of managed processes and unmanaged processes as a part of their application. They…


Socket Duplication – Part 1

Socket Duplication is a new feature supported in Whidbey.  So I thought a series on this feature will be very helpful to those who are going to use this API.   In this series, I will discuss how duplication is done in the unmanaged world, how it translates to managed code, some samples on how to do duplication and what…


Need to communicate across different Address Types?

Do you have  ipv4 only servers which you need to connect from ipv6 clients or viceversa? Portproxy is the solution. It acts like a proxy between ipv4 and ipv6 applications, forwarding requests based on the ipaddress and port. You can configure the proxy to forward  requests received on one / any of ipv6/ipv4 address,A port X to…


Tired of creating sockets for each protocol

Tired of creating sockets for each protocol, to make your application listen on all addresses for a given port ? . There is no more pain. Here is a cool new feature supported in Vista and Windows Server Longhorn. By just setting a socketoption, you will be able to use the same socket to accept connections from both…


Tips And Tricks

Planning on updating this section regularly with some Tips, Tricks and some TroubleShooting techniques. So if you have any, please post in the comments, I’ll add it to the article Tips: 1. Enable IPV6 on your machine: In WinXP SP2 / Win2k3, Execute netsh int ipv6 install. In Vista, it is enabled by default.     TroubleShooting: 1….



    In Whidbey, it is now possible to specify the local endpoint that the HttpWebRequest  should use when connecting to the other end. This can be done by setting the BindIPEndPointDelegate in the Servicepoint.   The HttpWebrequest has a Servicepoint property that returns the servicepoint associated with the request.   The delegate is called…