0

I want to query servers (about 100 can increase)

i am currently querying them iteratively in a loop one by one but it takes too much time.

I have found 2-3 options on net like MultiThreading , Netty etc.

Which one should i choose ?

here is the algo ->

Send 100 UDP packets to 100 servers at ONCE

100 servers respond with 1 UDP packet each .( No more communication is required)

i need to process that 1 UDP packet and store it somewhere. (My server should accept multiple packets at same time)

Edit: Game Servers

  • How do you want to handle UDP packets which get lost? – Peter Lawrey Jun 09 '12 at 16:23
  • If no reply is received then either packets are lost or server is offline . Timeout will serve the purpose for offline server.. lost packets are not a problem because i will be sending these 100 packets at a short interval of time. –  Jun 09 '12 at 16:32
  • In which case, you can just use DataGrams. You can also send packets a few times like retries if you don't get a response. – Peter Lawrey Jun 09 '12 at 16:33
  • What is it you need to know? Would a ping suffice? – Thorbjørn Ravn Andersen Jun 09 '12 at 16:37
  • should i use datagrams using multithreading ? will it work if server list gets huge ... I am using datagram packets currently but in a loop.. –  Jun 09 '12 at 16:38
  • @Thor server will reply with info which will be stored in DB –  Jun 09 '12 at 16:39
  • Considered making it the responsibility of each server to report back regularily? – Thorbjørn Ravn Andersen Jun 09 '12 at 16:49
  • servers are game servers which send reply if queried. –  Jun 09 '12 at 16:55
  • each server has different ip / port eg. 100.101.102.103:27035 , 200.201.202.203:27010 . i dont think multicast would be possible. –  Jun 10 '12 at 15:50

0 Answers0