Jump to content

UDP Packet Received Message

- - - - -

  • Please log in to reply
3 replies to this topic

#1
Ewe Loon

Ewe Loon

    Learning Programmer

  • Members
  • PipPipPip
  • 49 posts
When using DatagramSockets how do i know if there is a waiting packet,
Timeouts are unexcepable, as this is running in a system that cant afford delays

this is for a minecraft server plugin, if thats any help

#2
TheCompBoy

TheCompBoy

    Programming Professional

  • Members
  • PipPipPipPipPip
  • 272 posts
I never worked with Sockets or anything like it, So best i can do for you is providing some links to learn about it:

1. http://www.buyya.com...a/Chapter13.pdf
2. [Chapter 9] 9.2 Datagram Sockets

There should be containing some information.
Think my post we're usefull? Please take your time and press the Like button at my post, Big Thanks!
For great C# & Android tutorials visit my blogg: http://www.thecompboy.com/

#3
wim DC

wim DC

    Writes binary right handed and hex left handed

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 2,084 posts
  • Programming Language:Java, JavaScript, PL/SQL
  • Learning:Java
Can't you use the receive method in a try-catch in a while loop to continuously receive packets?

#4
WingedPanther

WingedPanther

    A spammer's worst nightmare

  • Moderators
  • 16,831 posts
  • Location:Upstate, South Carolina
  • Programming Language:C, C++, PL/SQL, Delphi/Object Pascal, Pascal, Transact-SQL, Others
  • Learning:Java, C#, PHP, JavaScript, Lisp, Fortran, Haskell, Others
Generally, UDP packets are "fire and forget". You don't get confirmation unless the listener specifically sends a confirmation message back. If you're doing that, why not use TCP instead of UDP?
Programming is a branch of mathematics.
My CodeCall Blog | My Personal Blog




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users