Menu

tcpservice demo

Help
Anonymous
2002-01-03
2002-01-12
  • Anonymous

    Anonymous - 2002-01-03

    Has anyone have any problems getting the tcpsession demo to work with 1.9.1+ libraries?  (tcpservice.cpp in the demo directory)
    I had it working with 1.6.2, but I've had no success with 1.9.x.
    Thanks

     
    • Anonymous

      Anonymous - 2002-01-03

      correction:
      the tcpSERVICE demo,
      not tcpsession..

       
    • Mark Farmer

      Mark Farmer - 2002-01-03

      That's ok, everybody makes mistakes.  Probably a cut and paste error? :)  Anyway, I too have noticed that the TCPService demo doesn't function anymore.  I have old versions of CC++ (1.4.3 and 1.5.0) where the TCPService demo works.  I can't get it to work at all under the 1.9.X versions.  I tried this using both Redhat 7.1 and 7.2.  Does anyone know what's going on?

      Mark

       
    • Nick Liebmann

      Nick Liebmann - 2002-01-04

      The problem is that ChatterThread::Run() is not being called. It is Supposed to be called when the semaphore is signalled. The semaphore IS being signalled but the thread is not started. Looks like some other bug in CCXX???

      To get it working, change the call in the ChatterThread constructor (~line 340) from Thread( sem ) to Thread()... And change the call in CCExec::RunApp from sem->Post() to my_Chatter->Start().

      One other modification which I found to be crucial to stop the thing hanging after a disconnection is as follows:

      In ChatterSession::ChatterSession()
      add the line setOutputDetect(true).

      The SampleSocketPort demo I wrote works for me 99% straight out of the box. Personally I think it is easier to understand too.
      The problem with it is that it does not seem to bind to 'localhost / 127.0.0.1'. It only binds to the real IP of the machine. Even though I create the InetHostAddress with INADDR_ANY! Is this another new bug, or am I missing something ?

      Nick

       
      • Frediano Ziglio

        Frediano Ziglio - 2002-01-06

        Good debugging.
        From 1.9.x (or early, I don't remember) all Thread constructor do not create any thread. System thread is created on Start. This for portability reason (Borland and MS compiler init virtual table after)

        I fixed tcpservice using Start.

        In next release I'll remove Thread copy contructor too, for the same reason

         
        • Frediano Ziglio

          Frediano Ziglio - 2002-01-10

          Tested on Solaris and problem raise :(
          Programmer is a hard work :)

           
          • Frediano Ziglio

            Frediano Ziglio - 2002-01-12

            select method now work correctly... but Solaris HAVE poll system call !!!

             

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.