Menu

How make thread-demo work ??????

Help
2000-07-03
2001-08-21
  • Benoit Plessis

    Benoit Plessis - 2000-07-03

    I am very intersseted in C++, for a long time, and
    when i found this projet, it was great !

    But i have a black sheep or what, i just can't make
    the tcpthread example work, (even with gcc/glibc beta
    it as worked one time, but no more). When the code raise
    the exception, the app goes in a endless trip (in socket fct)

    ANY HELP WOULD BE GREAT ! PLEASE

     
    • David Sugar

      David Sugar - 2000-07-14

      What compiler and platform are you using?

       
    • Anonymous

      Anonymous - 2001-08-08

      The tcpthread demo fails for me, too, on RedHat 7.1.

      kernel 2.4, gcc 2.96-85, glibc 2.2.2-10

      Commonc++ 1.5.0

      it works OK on a RedHat 6.2 system so I'm developing there for now, but will need to deploy (and do future development) on 7.1 systems, so any advice would be appreciated - including build commonc++ from CVS if it's fixed there.

      The binary I create on the 2.2 system seems to work OK on RedHat 7.1 if I link with -static, but bombs otherwise, so it's probably a glibc or an issue with the commonc++ library I compiled on the 7.1 system.

      The crash for me occurs in the derived TCPStream class constructor where it calls the base class constructor:

      myTCPSession::myTCPSession(TCPSocket &server) :
      TCPSession(NULL, server)

      a segfault occurs when it enters this constructor.

      Thanks in advance for any advice.

       
    • David Sugar

      David Sugar - 2001-08-15

      This had a lot to do with making Common C++ stream construction compliant with ISO.  In ISO, the iostream must be passed the streambuf in the constructor rather than thru a seperate init function.  This works I guess on an ISO system with aggregate classes, but certainly doesnt always on older C++ library implimentations, or at least depends on which order the component objects are constructed from the constructor itself, and hence is subject to implimentation dependencies!

      The solution I have come up with, for 1.5.1, is to directly test in autoconf if pre-ISO default iostream constructors are supported, and if so, use them in place of the ISO spec.  This makes Common C++ construct stream objects the same way it had in versions prior to 1.5.0, on older (and pre-gcc 3.0) systems.

       
    • Anonymous

      Anonymous - 2001-08-20

      thanks.  I'll wait for 1.5.1 and trust it will fix the problem.

       
    • Anonymous

      Anonymous - 2001-08-21

      1.5.1 seems to work fine on the 7.1 box.  Thanks!

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.