Go to Post 27 ft/s? They must really "Rush" around the field - Michael Corsetto [more]
Home
Go Back   Chief Delphi > Technical > Programming > Java
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
 
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 11-03-2012, 14:25
Ginto8's Avatar
Ginto8 Ginto8 is offline
Programming Lead
AKA: Joe Doyle
FRC #2729 (Storm)
Team Role: Programmer
 
Join Date: Oct 2010
Rookie Year: 2010
Location: Marlton, NJ
Posts: 174
Ginto8 is a glorious beacon of lightGinto8 is a glorious beacon of lightGinto8 is a glorious beacon of lightGinto8 is a glorious beacon of lightGinto8 is a glorious beacon of light
Re: URGENT Sending data over tcp

len is the number of bytes read by that specific call. Since there isn't always enough new data available to fill your buffer, read() lets you know exactly how much was there (or, more correctly, how much it copied into your buffer).

UDP is faster, but it's also a good bit riskier. TCP is nice because it guarantees that packets will arrive, that packets will not be corrupted, and that packets will arrive in the order they were sent. UDP guarantees nothing. However, since UDP doesn't have all those checks, it will be faster. Be careful using it, though, because you can no longer rely on any of the guarantees of TCP.
Reply With Quote
  #2   Spotlight this post!  
Unread 11-03-2012, 15:27
ProgrammerMatt ProgrammerMatt is offline
Programmer-Electrical-Mechanical
FRC #0228 (Gus)
Team Role: Mentor
 
Join Date: Jan 2011
Rookie Year: 2010
Location: Southington
Posts: 138
ProgrammerMatt is just really niceProgrammerMatt is just really niceProgrammerMatt is just really niceProgrammerMatt is just really nice
Re: URGENT Sending data over tcp

Quote:
Originally Posted by Ginto8 View Post
len is the number of bytes read by that specific call. Since there isn't always enough new data available to fill your buffer, read() lets you know exactly how much was there (or, more correctly, how much it copied into your buffer).

UDP is faster, but it's also a good bit riskier. TCP is nice because it guarantees that packets will arrive, that packets will not be corrupted, and that packets will arrive in the order they were sent. UDP guarantees nothing. However, since UDP doesn't have all those checks, it will be faster. Be careful using it, though, because you can no longer rely on any of the guarantees of TCP.
Is UDP supported? i dont think it is in this version of java
Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 09:48.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi