Performance issue with C++ ,Socket

Hi all,
I am facing some problem in Socket programming(C++ & Solaris 5.0).I am using socket as
basic connecting point & MEP(Mesagae Exchange Protocol) as high level protocol to send &
receive Message & ACK, between two different system.
MEP is a protocol through which you can send MSG through Socket & wait for the ACK for the
corresponding MSG & go on like this.When I am using our binary(s) between two different
Solaris Box(with diffrent IP) the transfer rate is quite good(Send one MSG & get ACKfor it
takes 1 milisec).
But the problem comes when I use the same binary(s) to do the above MSG processing in
the same Solaris box(with one IP), throughput goes very low (like 50 milisec for each MSG
processing).
I have tried with making the socket to work in non-blocking mod also.But that does not
help at all.
Looking for some quick help & hints to resolve this issue.