> > Problem: TCP/IP-App with BSD headers crashes in "inet_addr()".  
>
>     // without this def. gethostbyname() corrupts memory!!!!!!!
>     NetHostInfoBufType AppHostInfo;

Chris, that was exactly the hint I needed, thanks a lot!

Just defining AppHostInfo didn't help, though --- it would still crash.
I ended up declaring AppHostInfo, AppNetRefnum, AppNetTimeout, AppServInfo,
and h_errno as global.  Now it compiles, runs, and actually connects to
the server, but...

...another peculiar problem is that read() from a (tcp) socket returns -1,
i.e. no data.  So I fired up the debugger and traced the calls to read.
Surprisingly, everything worked fine now (data gets read and send as it
should be).  Again, without debugger --- nope, with debugger --- OK.

Does somebody have an idea why an app would work with gdb, but not without?

Cheers, Ren�


Reply via email to