Yup Syzop, you were totally right. It was not related to IRCD, but the connection between php server and ajax was getting timed out.
I should have known that before, but got confused due to IRCd also closing the connection.
Anways thanks all for your time
