Socket Programming-UDP

UDP Program to print welcome


Create 2 Files:
1)dsender.java
2)dreceiver.java

dsender.java


import java.net.*; //for java programming we have to use this package

public class dsender //class name should be name as file name
{
public static void main(String args[]) throws Exception //throws exception should be written
{
DatagramSocket ds = new DatagramSocket(); //socket will create an interface to throw/send and receive data
String str = “Welcome”;
InetAddress ip= InetAddress.getByName(“localhost”); //Inet address-> class of ip address…write ip address in place of localhost
DatagramPacket dp = new DatagramPacket(str.getBytes(),str.length(),ip,3001); //datagram packet converts string into bytes,it consists of size of string,ip address,port number
ds.send(dp);
ds.close(); //if socket is not closed it will use system resources
}
}
 
 
dreceiver.java
import java.net.*;
 
public class dreceiver
{
public static void main(String args[]) throws Exception
{
DatagramSocket ds = new DatagramSocket(3001);
byte[] buf=new byte[1024]; //creating memory space for array of bytes
DatagramPacket dp = new DatagramPacket(buf,1024); //creating a blank packet for receiving data of 1024 buffer size
ds.receive(dp); //data stored in blank packet
String str= new String(dp.getData(),0,dp.getLength()); //convert byte into string
System.out.println(str); //display output
ds.close();
}
}

OUTPUT:

319 thoughts on “Socket Programming-UDP

  1. Pingback: Google
  2. Pingback: Anal
  3. Pingback: Lawn
  4. Pingback: 188bet
  5. Pingback: app for laptop
  6. Pingback: max penis pump
  7. Pingback: webcam sex
  8. Pingback: speelgoed kopen
  9. Pingback: app for pc
  10. Pingback: couples sex toys
  11. Pingback: hamptonbaylighting
  12. Pingback: Gurgaon
  13. Pingback: cursos gratuitos
  14. Pingback: cock ring
  15. Pingback: dani best videos
  16. Pingback: webcam babes
  17. Pingback: shemale sexdate
  18. Pingback: rencontres adulte
  19. Pingback: webcambabes
  20. Pingback: anal training kit
  21. Pingback: vibrator for her
  22. Pingback: suction cup dildo
  23. Pingback: powerful vibe
  24. Pingback: sex toys
  25. Pingback: gay porn dildo
  26. Pingback: penis masturbator
  27. Pingback: vagina toy
  28. Pingback: increase penis
  29. Pingback: anal dildo
  30. Pingback: real penis dildo
  31. Pingback: Porn
  32. Pingback: gay plug
  33. Pingback: Tadapox
  34. Pingback: what are push ads
  35. Pingback: белл бой
  36. Pingback: best penis ring
  37. Pingback: squirting dildo
  38. Pingback: ben wa balls
  39. Pingback: warming rabbit
  40. Pingback: rtd principle
  41. Pingback: pleasure panty
  42. Pingback: satta matka
  43. Pingback: egg bullet
  44. Pingback: best double dildo
  45. Pingback: vagina dilator
  46. Pingback: gay bondage gear
  47. Pingback: porn
  48. Pingback: vibrating ring
  49. Pingback: vibrating penis
  50. Pingback: jockstrap brief
  51. Pingback: male stroker toy
  52. Pingback: good blow job
  53. Pingback: career
  54. Pingback: male stroker
  55. Pingback: hire a skip bin
  56. Pingback: commission
  57. Pingback: SSRU
  58. Pingback: huge dildo
  59. Pingback: rabbit vibrators
  60. Pingback: how to use a dildo
  61. Pingback: newest vibrator
  62. Pingback: sex paddles
  63. Pingback: unboxing vibrator
  64. Pingback: sexy bdsm
  65. Pingback: ps4 games
  66. Pingback: porn
  67. Pingback: huge veiny dildo
  68. Pingback: Body stockings
  69. Pingback: trixie hundeseng
  70. Pingback: Julia Ann Porn
  71. Pingback: Fashion Station
  72. Pingback: sexboer
  73. Pingback: porno files
  74. Pingback: geile sex filmpjes
  75. Pingback: gratis films
  76. Pingback: pornofilmpjes
  77. Pingback: liteblue login
  78. Pingback: u-host iptv review
  79. Pingback: liteblue
  80. Pingback: homemade dildo
  81. Pingback: porn
  82. Pingback: wanachi waterproof
  83. Pingback: virtual visa card
  84. Pingback: cheap flights
  85. Pingback: penis enlargement
  86. Pingback: huge dildos
  87. Pingback: Bluechew reviews
  88. Pingback: walmartone login
  89. Pingback: indian porn
  90. Pingback: Don Karl Juravin
  91. Pingback: ormekur hund pris
  92. Pingback: boite hotmail
  93. Pingback: bdsm
  94. Pingback: SUC Elibrary
  95. Pingback: bondage gear
  96. Pingback: safeway hours
  97. Pingback: sex toys for clit
  98. Pingback: BWI transportation
  99. Pingback: vibrator reviews
  100. Pingback: maxbet
  101. Pingback: iCloud Login
  102. Pingback: Hotmail login
  103. Pingback: hasta yatağı
  104. Pingback: viagra
  105. Pingback: porn free
  106. Pingback: jockstrap thong
  107. Pingback: vagina stroker
  108. Pingback: best gay sex toys
  109. Pingback: cock ring
  110. Pingback: doc johnson
  111. Pingback: MIDE-675
  112. Pingback: xlxx
  113. Pingback: YtMp3
  114. Pingback: best p spot toy
  115. Pingback: Walmart One
  116. Pingback: websites
  117. Pingback: hotmail.com login
  118. Pingback: pppd 780
  119. Pingback: SSNI-550
  120. Pingback: anal plugs
  121. Pingback: Lifestyle news
  122. Pingback: tura beach seo
  123. Pingback: dildo porn
  124. Pingback: prepaidgiftbalance
  125. Pingback: NHDTB-305
  126. Pingback: 192 168 1 1 admin
  127. Pingback: powerful massager
  128. Pingback: vibrating panties
  129. Pingback: virtual Product
  130. Pingback: CAWD-008
  131. Pingback: realistic dildo
  132. Pingback: cock ring
  133. Pingback: guitar licks
  134. Pingback: male stroker toy
  135. Pingback: full apps download
  136. Pingback: virtual number buy
  137. Pingback: dank cartridges
  138. Pingback: Boston Car Service
  139. Pingback: Eweka
  140. Pingback: oral sex for men
  141. Pingback: virgin coconut oil
  142. Pingback: exotic carts pen
  143. Pingback: supreme cartridge
  144. Pingback: Melbourne Lawyer
  145. Pingback: Dank Vapes
  146. Pingback: Teen Swallow load
  147. Pingback: lose weight sleep
  148. Pingback: ABP-897
  149. Pingback: runelite
  150. Pingback: mygiftcardsite.com
  151. Pingback: Cool t shirts
  152. Pingback: MEYD 533
  153. Pingback: Women clothing
  154. Pingback: 618media.com
  155. Pingback: NBA
  156. Pingback: adam and eve haul
  157. Pingback: p spot
  158. Pingback: Ioe news
  159. Pingback: buy xanax online
  160. Pingback: king pen
  161. Pingback: LiteBlue
  162. Pingback: exotic cartridges
  163. Pingback: bdsm sex toys
  164. Pingback: anal lubricant
  165. Pingback: Islay whisky tour
  166. Pingback: IPX 368
  167. Pingback: Judi Slot Online
  168. Pingback: gold investment
  169. Pingback: SEO Vancouver
  170. Pingback: PPPD 786
  171. Pingback: daftar joker123
  172. Pingback: HUNTA-653
  173. Pingback: Juhu Escorts
  174. Pingback: door sex swing

Leave a Reply