Menu

tcpstream problems on NT4.0 (VC++ 6.0)

Help
Noel Byron
2000-08-29
2000-08-30
  • Noel Byron

    Noel Byron - 2000-08-29

    Hi,

    after compiling CommonC++ and installing the DLL, LIB and headerfiles I tried out the following
    code:
    #include <c++/socket.h>
    int main(int argc, char* argv[])
    {
        tcpstream client;
                 cout << "End" << endl;
                 return 0;
    }
    This little program showed me End as expected but terminated with a segmentation fault.
    Leaving out the cout line fixed this problem...

    The next things I added to the code was
    client.open("www.foo.com:80");
    client << "GET \ HTTP1.1" << endl << endl;
    But the << resulted in another fault. I started my debugger and observed the Allocate()
    methode which is called within open(). This methode sets the important gbuf and pbuf
    buffers quite well. But right after returning to my main program I recognized that pbuf
    and gbuf are not valid any more!

    This and the compiler warnings (the one that points out that the iostream class is not
    exportet out of the DLL) makes me think that the TCPStream will not work within DLL's
    at all. Am I right? Is there anybody else out there with the same problems?

    Will a library build fix this problem? I want to write a C++ wrapper around the OpenSSL and
    need a portable library which provides threads and TCP sockets. I would love to help you
    with this problem but I don't know much about this DLL stuff...

    Kind regards,
    Noel

     
    • David Sugar

      David Sugar - 2000-08-30

      Could you resubmit this as a bug report?  (or maybe you already have...I will check that next...).

       

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.