|
-
December 18th, 2007, 04:59 PM
#2
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|