refs #14. optimize the process of channel manage. Fix some bugs.
refs #14. temporary submit.
refs #14. adapter source code to win32 plateform.
Merge pull request #17 from jcrom/master

merge with trunk