Thread: BSD Socket Server Problem

  1. #1
    Registered User
    Join Date
    Jan 2009
    Posts
    1

    BSD Socket Server Problem

    Hi,

    I have been working on a server using BSD sockets. However, sometimes I'll add a printf for debugging and the server won't accept any requests. Also, this is a server that's multi-threaded using fork(). Some printf statements work okay while others don't. Any Ideas?

    Thanks.

  2. #2
    Registered User
    Join Date
    Jan 2009
    Posts
    7
    Some more information is required...may be a bit of server code that is causing problems??

  3. #3
    Registered User
    Join Date
    Apr 2008
    Posts
    396
    multi-threaded using fork()
    this does not compute.

  4. #4
    gcc -Wall -pedantic *.c
    Join Date
    Jan 2009
    Location
    London
    Posts
    60
    Is it multi-threaded or multi-processed?.. Cause fork() generates processes.
    Use fprintf(stderr, ....) instead of printf(), or just flush the buffer after every time you call printf().

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. server client problem
    By rudeboy in forum Networking/Device Communication
    Replies: 5
    Last Post: 05-17-2008, 12:41 AM
  2. socket message sending and receiving problem
    By black in forum C Programming
    Replies: 5
    Last Post: 01-15-2007, 04:46 AM
  3. Client/Server Socket Receive Problem
    By mariabair in forum Networking/Device Communication
    Replies: 6
    Last Post: 12-25-2003, 10:01 AM
  4. socket question
    By Unregistered in forum C Programming
    Replies: 3
    Last Post: 07-19-2002, 01:54 PM
  5. Socket Problems
    By (TNT) in forum Windows Programming
    Replies: 4
    Last Post: 08-18-2001, 06:59 AM

Tags for this Thread