Lu5ck
December 18th, 2007, 04:13 PM
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
j0nas
December 18th, 2007, 04:59 PM
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.