It looks like mIRC's receive buffer doesn't get flushed when the socket is closed. Here's a code snippet to illustrate:
/* server.c */
char *message = ":irc.example.com NOTICE AUTH :This is some text to send\r\n";
new_socket = accept(create_socket,(struct sockaddr *)&address, &addrlen);
send(new_socket, message, strlen(message), 0);
When mIRC connects it displays the usual "Software caused connection abort", but with out the message... add a sleep(1); before close(); and it works as expected.
Perhaps codemastr or someone more familiar with the issue could chime in if I'm missing something.