Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. How to use UdpClient class?

How to use UdpClient class?

Scheduled Pinned Locked Moved C#
questionsysadminhelptutorialworkspace
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    skywen
    wrote on last edited by
    #1

    I am trying to receive the udp datagram that from the client sended to the server port 7090,but i have some questions following. 1) How to listen to port 7090? Should I setup a timer to scan port 7090? 2) Is there a event that start when the udp datagram get to the server and how to implement? 3) If many client send to the same server port 7090 in the same time. How can I to sure which one is from where? thanks for your help!

    H 1 Reply Last reply
    0
    • S skywen

      I am trying to receive the udp datagram that from the client sended to the server port 7090,but i have some questions following. 1) How to listen to port 7090? Should I setup a timer to scan port 7090? 2) Is there a event that start when the udp datagram get to the server and how to implement? 3) If many client send to the same server port 7090 in the same time. How can I to sure which one is from where? thanks for your help!

      H Offline
      H Offline
      Heath Stewart
      wrote on last edited by
      #2

      UdpClient.Receive is a blocking call, and there is no events on the UdpClient. You use it to send packets to a server or multicast group and then call UdpClient.Receive to wait for a response. You should read the class documentation[^] for the UdpClient in the .NET Framework SDK. It contains all the information you should need plus many examples of how to use it.

      Microsoft MVP, Visual C# My Articles

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups