Recently I have done this part of code: http://dumpz.org/14945/
It does work, but select() works bad. When it has got last reply from server, it begins repeating last reply string with some strange characters in the beginning of reply string. So look at this:
:[email protected] PRIVMSG testuser1 :VERSION
�C���C��[email protected] PRIVMSG testuser1 :VERSION
�C���C��[email protected] PRIVMSG testuser1 :VERSION
�C���C��[email protected] PRIVMSG testuser1 :VERSION
�C���C��[email protected] PRIVMSG testuser1 :VERSION
The first string is the last reply from server. So next strings are just some junk. I tried to look for information in some search engines, but no luck.