UDP server / client file transfer
i need to create a sever nd a client in java, which i managed to do, problem is that now i need to be able to send a file from server to client, which needs to be sent line by line. basically implementing a simple stop and wait protocol. any idea how to do this pls ?
Re: UDP server / client file transfer
If you are sending the lines separately and want to be sure that they all arrive and are kept in order, define a protocol that includes a header record that would include the line number of the line being sent. You might have the server ask for the lines by number in its request for a line.
Server: Give me line 1
Client: Here is line 1 .... line 1's data ...
Server: Give me line 2
Client: Here is line 2 .... line 2's data ...
Whoops reverse client and server names.