I have wrote a socket program where the host will receive file and client will send ( as far as I am concerned )
It looks like the server is the one sending the file and the client is receiving.
However, today when I checked it,I saw if I run the Host, nothing happens. But When I run the Client side, server side start prompting and asks me for file to send. and then server starts sending the file to my client pc.
That's exactly how client-server applications work. The server sits there waiting until the client connects. In your application, the server doesn't actually prompt the user for anything. All the prompts are in your client code. Once the client connects, the server goes and pushes its file down the socket to the client.
I don't see anything wrong with this application besides the confusion between what the server and client are actually doing.
As for your second question, I can't help you there. Trying asking it in another question.