CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2

Thread: Winsock

  1. #1
    Join Date
    Dec 2006
    Posts
    56

    Winsock

    Hi all,

    I want to learn about winsock using "Windows Forms Application". Is there any tutorial with example related to "Windows Forms Application"? All I can find is tutorial with example of Win32 application.

    Thanks

  2. #2
    Join Date
    Aug 2001
    Location
    Stockholm, Sweden
    Posts
    1,664

    Re: Winsock

    Try to separate the UI and network stuff from each other. It is a bad idea to use network calls directly in Windows Form code. Add one or two abstraction layers... If you for instance want to implement a GUI chat program, hide the network implementation inside a library/component/file. Export functions like ChatWriteMsg(...), ChatReadMsg(...), etc...

    The very first thing you will run into, when it comes to GUI and networking, is the "blocking" issue. All functions that carry out network operations, must not "block"-- it will otherwise make the GUI unresponsive. So, with my chat-example, the ChatWriteMsg function must return directly and later notify the GUI when the msg actually was transmitted.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured