BSD Socket Server Problem

This is a discussion on BSD Socket Server Problem within the C Programming forums, part of the General Programming Boards category; Hi, I have been working on a server using BSD sockets. However, sometimes I'll add a printf for debugging and ...

  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
    395
    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, 01: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, 02:54 PM
  5. Socket Problems
    By (TNT) in forum Windows Programming
    Replies: 4
    Last Post: 08-18-2001, 07:59 AM

Tags for this Thread


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21