Java socket programming question
It is the 1st time I seft-study Java and socket programming, and I just started about a week ago, so bear with me.
What Im trying to do is create a network of 3 machines, server, relay and client for reliable data transfer. The client and server dont communicate directly, but via the relay. The client sends a number of packets, one by one, some of them will be dumped (dropped) at the relay.
The reliable transfer method will be implement like this
- Create a protocol.
- Use sequence number. For instance, if the server receives packet which sequence numbers are 1, 2 but the next one is 4, not 3 as expected, it will send a NACK to the relay, the relay now forward the NACK to the client. The client has 2 options, if it is an ACK, sends the packet with the next sequence number, if it is a NACK, retransmit the previous packet.
- Use the timer. Once received packet x, the server sets timeout for the next packet. If timeout is reached, it will send a NACK, and the client will restransmit the packet.
So what I have done is create a protocol, set up a communication between the client and relay. Now I get stuck because I dont know how to implement the sequence number.
I did a search on Google and found 2 functions:
|Thread||Thread Starter||Forum||Replies||Last Post|
|external drive partition question + fdisk question||gosha||OpenBSD General||15||15th June 2009 03:00 PM|
|apache: data stuck in socket?||goertzenator||FreeBSD General||8||16th February 2009 04:01 PM|
|Java and AI-programming||idefix||Programming||4||7th February 2009 01:41 PM|
|Socket A Semprons||Sonya||General Hardware||7||17th January 2009 04:32 AM|
|Installing java question||neurosis||FreeBSD Ports and Packages||3||22nd July 2008 03:42 AM|