Thread: Socket Destination Port Problem

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Hurry Slowly vart's Avatar
    Join Date
    Oct 2006
    Location
    Rishon LeZion, Israel
    Posts
    6,788
    Quote Originally Posted by radeberger View Post
    what would you recommend me to synchronize the cout on the screen? a mutex or a semaphore?
    what do you want to synchronize cout with?

    If you are using MS multi-threaded library - cout is alrady synchronized
    All problems in computer science can be solved by another level of indirection,
    except for the problem of too many layers of indirection.
    – David J. Wheeler

  2. #2
    Registered User
    Join Date
    Mar 2009
    Posts
    35
    I don't want that two threads print out something on the screen at the same time

  3. #3
    Registered User
    Join Date
    Mar 2009
    Posts
    35
    Hi everybody,

    I found the error. I used the function recevfrom and the last two paramaters are a pointer to a buffer in a sockaddr structure that will hold the source address upon return and the length. My error was that I wrote there the address structure that I wanted to use later...Of course the recevfrom copies other values there....

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. A question related to strcmp
    By meili100 in forum C++ Programming
    Replies: 6
    Last Post: 07-07-2007, 02:51 PM
  2. Datagram Unix socket problem
    By karas in forum C Programming
    Replies: 9
    Last Post: 07-27-2006, 10:08 AM
  3. Socket Help - Multiple Clients
    By project95talon in forum C Programming
    Replies: 5
    Last Post: 11-17-2005, 02:51 AM
  4. sockets problem programming
    By kavejska in forum C Programming
    Replies: 0
    Last Post: 07-25-2005, 07:01 AM
  5. Using Sockets to post to port
    By WaterNut in forum Windows Programming
    Replies: 3
    Last Post: 04-15-2005, 04:10 PM