while we are at this post ,i would like to ask one more thing. when i am just using winsock.senddata it works fine but when i am using it under if and else statement the data does not get sent immediately instead it fires only after i receive a message or send another data . why is it so ? and how can i overcome it ?