ok the code is working now. there is a problem with it.
the first string from the server reaches the client immediately.
how ever the string from the client containing the user name password is not displayed on the server side.
but if i control+c and exit than it displays the string.
but if i terminate from the server side nothing is displayed.