Hello Friends, after long day’s gap I am writing some blog for you. During this time many things has changed in technological world like earlier I write code with VS 2008 and now VS 2012 has released. Also lots of changes in our life too. I believe this time I can write my blog with better English than earlier, which will help you to read this. Ok lets read this post about to learn new thing which is about to send small file from server to client. This is just opposite of sending file from client to server. This is the basic of large file transfer, later I shall use the same thing to send large file from server to client and finally will use both (client to server and server to client) large file transfer code client to client. I shall come to that point step by step.
To send file from server to client there must be two applications that is Server application and client application. In code I have mentioned these two parts individually. In below section I am describing Server action means server application is working and you need to check server code, for client action need to check client code. Handshaking of these two socket programming applications should be following:
1) Server Action: First need to run server application, this server application will open an endpoint with predefined IP address and port number and will remain in listen mode to accept new socket connection request from client.
IPEndPoint ipEnd = new IPEndPoint(IPAddress.Any, 5656); Socket sock = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.IP); sock.Bind(ipEnd); sock.Listen(100);