Hello All,
I need some help in resolving an issue I'm facing an with communication of a desktop client with WCF service hosted on IIS.
What I'm trying to do in my test case:
- Server hosts a WSDualHttpBinding service
- Client establishes a connection (calls Register method) to this by providing its callback uri which contains the client’s IP Address
- Once connection is established, a web page is launched by the client application. User types some text into the textbox and clicks Send. The web page sends the text to all registered desktop clients.
Issue:
In step 2, a PC may have multiple IP Addresses (Ethernet adapter, loopback adapters etc). If during the registration call, an IP from this list is sent in the callback url which cannot be called back from the server (e.g. loopback adapter IP), a timeout exception is thrown. After a few such attempts, the server cannot accept calls from clients anymore (whether valid IP or otherwise). Sometimes “server too-busy” exception was thrown.
(I cannot use machine’s fully qualified name in the callback uri due to DNS/WINS configuration issues causing the server to not not resolve machine name to the correct IP address).
How to reproduce:
a. Publish the server on IIS. From a different machine with multiple IP addresses, execute the client. The client throws timeout exceptions and program exits after 3 tries
b. A parameter in the App.Config allows one to type in the right IP address (IP to use). Now if the program is launched, everything works fine.
c. If I remove this IP address specified above so that an incorrect IP is used, again step a happens. Run the programs 2-3 times in this mode.
d. Make changes as in step b and run the program. Sometimes I get a timeout exception. Other times, the web site comes up. However when text is entered and sent, it doesn't come to the client. (The register method worked even though web service did not receive any call. Sending function fails as there are no registered clients on the web service.
I’m not sure why exactly this happens and how to address it. Here is my Visual studio solution - http://bit.ly/atKfOS
Highly appreciate any inputs, comments. Environment: Server - Windows XP (IIS 5), Windows Server 2008 SP2 x64 (IIS 7), Client: Windows XP
Thanks GC