You can see what mIRC is sending by opening a debug window: /debug @debug

Why are you using sockets to connect to an irc server?