Results 1 to 2 of 2
  1. #1
    jakevella is offline Member
    Join Date
    Jan 2012
    Posts
    1
    Rep Power
    0

    Default 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 ?

  2. #2
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,266
    Rep Power
    25

    Default 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.

Similar Threads

  1. To transfer a file from client to server
    By phani in forum Networking
    Replies: 4
    Last Post: 10-12-2010, 06:15 PM
  2. How to upload a file from client to server
    By john_thomas03 in forum New To Java
    Replies: 4
    Last Post: 07-26-2010, 02:00 PM
  3. File transfer from Client to server
    By xemeGa in forum New To Java
    Replies: 0
    Last Post: 05-05-2010, 03:59 PM
  4. Replies: 8
    Last Post: 02-18-2010, 12:54 PM
  5. Replies: 3
    Last Post: 07-29-2009, 04:52 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •