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. Problem in Threading

Problem in Threading

Scheduled Pinned Locked Moved C#
help
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.
  • M Offline
    M Offline
    Mohammed Aijaz Mohiuddin
    wrote on last edited by
    #1

    Following is my code for a simple thread public static void U() { IPEndPoint ipe = new IPEndPoint(IPAddress.Any,1238); EndPoint LocalEP = (EndPoint) ipe; //Socket ServerSocket = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp); //ServerSocket.Bind(LocalEP); Console.WriteLine("I am codeproject user"); while(true) { Thread.Sleep(10); Console.Write(". "); } } It is surprised that when I use //Socket ServerSocket = new Socket(AddressFamily.InterNetwork,SocketType.Dgram, ProtocolType.Udp); the thread is not working .

    D 1 Reply Last reply
    0
    • M Mohammed Aijaz Mohiuddin

      Following is my code for a simple thread public static void U() { IPEndPoint ipe = new IPEndPoint(IPAddress.Any,1238); EndPoint LocalEP = (EndPoint) ipe; //Socket ServerSocket = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp); //ServerSocket.Bind(LocalEP); Console.WriteLine("I am codeproject user"); while(true) { Thread.Sleep(10); Console.Write(". "); } } It is surprised that when I use //Socket ServerSocket = new Socket(AddressFamily.InterNetwork,SocketType.Dgram, ProtocolType.Udp); the thread is not working .

      D Offline
      D Offline
      Dave Kreskowiak
      wrote on last edited by
      #2

      Funny... I don't see any code in your post that creates a new thread, so yes, it doesn't work. What are you trying to accomplish? I assume it's a multithreaded server application that accept client connections and launches a new thread for each client. But in your case, you never started a listener, so I fail to see how your even going to accept connections... RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome

      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