here's a record of some of my a)stupidity and b)confusion...
so... I've got a method that could be called "at any time", yadda...
now, java doesn't have this "variables declared on the stack" versus "variables declared on the heap" business...
I guess I don't have any experience with threaded c apps. at least, not with threads that did anything important...
okay, so... I've got a method that could be called "at any time", yadda.
it's: void response(char *);
now in response, I want to build a char* and "send" it. send is asynchronous as far as I can tell -- it doesn't wait for the thing to actually be sent before returning.
so if I make buf (the char* I'm building) a malloc'd entity... oh, duh. that works just fine. I was for some reason making it a globally malloc'd entity. that was stupid.
okay, now I have this malloc'd entity which should work fine and be all happy and stuff... but I don't see where I get to free it... that bad.
since the send just goes off in its own little world, umm, er....? :meep:
[back from fiddling with code]
now that I've got my buf malloc'd I'm getting "out of memory" errors...
The oom's appear to be when I try to send the malloc'd buffer...
*arOut << buf << "\n"; // arOut is a CArchive wrapped around a CSocketFile, which was made from the CSocket...
trying to just do *socket->Send(buf,strlen(buf)) gives me an "access violation".
hell, I just don't know. I just don't know.