in
Welcome to Lionhead Community Sign in to Windows Live ID | Help

The windows communication foundation is a nightmare!

Last post 07-29-2009, 2:22 by Pandilex2. 3 replies.
Sort Posts: Previous Next
  •  07-18-2009, 13:43 3375267

    The windows communication foundation is a nightmare!

    I spent a long time with sockets in C#, a very very long time indeed. They were poorly documented and caused me no end of grief with bizarre quirks and such.

    I finally decided to make the move to the WCF to see if I it was easier to get along with, but I have found it to be a nightmare so far... there is also a laughable amount of documentation and tutorials available for it, so I was wondering if anyone has had any success with it.

    All I want to do is have a server, and a client, making a tcp connection and sending data back and forth.

    After a huge amount of struggling on my own, I gave up and bought a c# book that covers it in one chapter. I followed the tutorial and made a simple http based server/client. I then tried to adapt it to using tcp, and now svcutil can't generate me a client because "the connection was closed by the remote host". The same thing worked fine before I switched it over to tcp...

    It's driving me nuts, I have been trying to get it working for 3 days now and it's all trial and error... does anyone have any advice?
  •  07-25-2009, 20:01 3378718 in reply to 3375267

    Re: The windows communication foundation is a nightmare!

    I personally can't help you.

    But if you can't seem to find an answer here, I suggest you use Jeff Atwood's "Digg"-style programming-help forum, Stack Overflow. Ask your question there and you're bound to get an answer within an hour.

    Philosophical Ninja.
  •  07-28-2009, 20:54 3379640 in reply to 3375267

    Re: The windows communication foundation is a nightmare!

    sockets in C# are one of the easier implementations I have seen.  There's a rather simple TCP example here:  http://www.csharphelp.com/archives/archive127.html

    I'm a bit confused by your statement about building an http client/server and then breaking it when moving to tcp... http is built on top of tcp.

     

  •  07-29-2009, 2:22 3379680 in reply to 3379640

    Re: The windows communication foundation is a nightmare!

    Sockets in C# are really easy to implement and use for a simple chat program, but when you try anything heavier and more complex, they start to break in ways you can't understand because of the poor documentation, something 99% of tutorials miss because they think a simple chat program is all you need to be able to write to use them successfully. The latest in a long line of problems I had was detecting whether a client had disconnected - the Connected property continued to return true and it continued to have no problems sending data even though I had closed the client. There was one hacky workaround I found on google somewhere, but why? I got tired of constantly having to implement workarounds for stuff. Another example is when the send buffer became overloaded when trying to transfer something large, and crashed the send part of the client, but not the receive part. It's almost undocumented and so very hard to figure out how to handle it.
    These reasons and more I decided to switch to the WCF, which is also not very well documented, but after several days of pulling my hair out I finally managed to get it working.
    I also couldn't understand how changing the protocol (something that is supposed to be seamless in WCF) broke the client/server, but I have it sorted now. I can't remember what the problem was either.

    Cheers though.
View as RSS news feed in XML