DaemonForums  

Go Back   DaemonForums > Miscellaneous > Programming

Programming C, bash, Python, Perl, PHP, Java, you name it.

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1   (View Single Post)  
Old 3rd May 2008
18Googol2's Avatar
18Googol2 18Googol2 is offline
Real Name: whoami
Spam Deminer
 
Join Date: Apr 2008
Location: pwd
Posts: 283
Arrow 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:

Code:
getSequenceNumber()
setSequenceNumber()
But I think I have a brainstorm atm, can anyone gives me a simple example how to use those functions please.
Reply With Quote
 

Tags
java

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
external drive partition question + fdisk question gosha OpenBSD General 15 15th June 2009 02: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 02:42 AM


All times are GMT. The time now is 02:01 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Content copyright © 2007-2010, the authors
Daemon image copyright ©1988, Marshall Kirk McKusick