Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 3 of 3

Thread: n.w

  1. #1
    Junior Member
    Join Date
    Dec 2013
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default n.w

    1) Write a java program to implement a simple File Transfer Protocol by using connectionless Socket that works as follows: At the client side, the file to be transferred is divided into units of 100 bytes (and may be less than 100 bytes for the last unit depending on the size of the file). The client transfers each unit of the file to the server and but there is no acknowledgment required from the server side. did not match with any Answers results.

  2. #2
    Administrator copeg's Avatar
    Join Date
    Oct 2009
    Location
    US
    Posts
    5,301
    Thanks
    180
    Thanked 824 Times in 767 Posts
    Blog Entries
    5

  3. #3
    Member andbin's Avatar
    Join Date
    Dec 2013
    Location
    Italy
    Posts
    443
    Thanks
    4
    Thanked 122 Times in 114 Posts

    Default Re: n.w

    Quote Originally Posted by fikr View Post
    using connectionless Socket
    And for "connectionless Socket" you mean "datagram" (UDP) socket, isn't it? You need DatagramSocket/DatagramPacket from java.net package.

    Quote Originally Posted by fikr View Post
    The client transfers each unit of the file to the server and but there is no acknowledgment required from the server side. did not match with any Answers results.
    Yes, with datagram sockets you don't have any acknowledge by itself, packets can arrive, never arrive, arrive duplicated (for some networking reasons) and also, more important, arrive not in the same order as they are sent.

    You must be very careful, at least (take this as a hint) put an incremental counter in each packet, so that the receiver can know the order of packets and also if some packet is lost. Otherwise a "File Transfer Protocol" in this way is totally pointless.
    Andrea, www.andbin.net SCJP 5 (91%) SCWCD 5 (94%)

    Useful links for Java beginners My new project Java Examples on Google Code