Re: communication with a daemon

From: Paul D. Boyle (boyle_at_laue.chem.ncsu.edu)
Date: 08/05/04

  • Next message: Bob Smith: "Re: syslog_r"
    Date: Thu, 5 Aug 2004 17:59:49 +0000 (UTC)
    
    

    Tobias Wagner <none@rz.uni-karlsruhe.de> wrote:
    : I've tried with Unix Domain Sockets and the gcc extension stdio_filebuf. But
    : the problem is that the server does not realize, that he could read some
    : data. The server process waits at line "while (client_str >> msg)". Only if
    : the client process is killed, the sent message from the client is printed.
    : What's wrong?

    I don't know for sure, but this sounds like a buffering problem.
    It is usually a bad idea to mix higher level I/O functions (e.g. stdio,
    iostream) with low level system calls like write(2), read(2). This is
    because the higher level calls use internal buffers for I/O efficency,
    while the system calls are not buffered. I don't know C++, but in using
    C'isms, you could marshall your messages in a buffer with snprintf(3),
    then write(2) them.

    Any easy way to test the above hypothesis is to fflush() your output
    stream on the client end and see if that changes the behavior.

    Paul

    -- 
    Paul D. Boyle
    boyle@laue.chem.ncsu.edu
    North Carolina State University
    http://www.xray.ncsu.edu
    

  • Next message: Bob Smith: "Re: syslog_r"

    Relevant Pages

    • Re: Network File Access Performance
      ... Most runtime libraries do some amount of I/O buffering. ... presumably using the CIFS protocol. ... But if another client accesses the file, ...
      (comp.lang.fortran)
    • Re: Disable IIS5 asp buffering good idea ?
      ... Once the send is completed, ASP will begin executing again. ... One other thought is that disabling reponse buffering may have no effect. ... > Server 2000 backend server. ... > formated html data to the client. ...
      (microsoft.public.inetserver.iis)
    • Re: Are there any setting that can be changed to prevent responce
      ... Could you tell us how you are interacting with the database. ... Or are you using Virtual Channel API’s to communicate between client and Terminal server machines? ... When there is a delay in the responce from ... > Are there any setting that can be changed to prevent responce> buffering? ...
      (microsoft.public.windows.terminal_services)
    • Re: Buffering issue
      ... I don't see from your description why you need to turn buffering off. ... Client side operations should not be impacted by ... Is IIS taking a long time ... > Windows 2003 settings) that I should be on the lookout for? ...
      (microsoft.public.inetserver.iis)
    • Re: Buffering issue
      ... > another server it does not. ... Whether it is on the client, ... >> a) I don't see from your description why you need to turn buffering off. ... Is IIS taking a long ...
      (microsoft.public.inetserver.iis)