my code didnt have enough for the test to work properly.. This should do the trick.

Code:
alias sendchat { socklisten testchat1 $$2 | .raw privmsg $1 $+(:,$chr(1),DCC CHAT CHAT $longip($ip) $2,$chr(1)) }
on *:socklisten:testchat1:sockaccept testchat2 | sockwrite -n testchat2 success! | sockclose testchat*