Stack leak in ReadClientSocket?

Discussion in 'C-Touch/HomeGate/SchedulePlus/PICED Software' started by Serban, Jul 23, 2007.

  1. Serban

    Serban

    Joined:
    Jul 23, 2007
    Messages:
    1
    Likes Received:
    0
    Hoi all,

    Just stared to use clipsal in my house and im making a video/audio page inside piced. I made a server app on my computer to handel all the requests from my toutchscreen. All wordk great but after a while piced gives an out of memory error.

    It seems to happen every time i use the 'ReadClientSocket' function.
    Is this a bug or am i doing something wrong?

    The code im justing works like this:


    if not ClientSocketConnected then
    OpenClientSocket('127.0.0.1', 23);

    if ClientSocketConnected then
    begin
    writeln('client connected');
    repeat
    ReadClientSocket(s, #13#10);
    if s <> '' then
    begin
    writeln(s);
    WriteClientSocket(s);
    WriteClientSocket(#13#10);
    end;
    until s = '';
    end;


    I also tried to do the same thing while making the server a host and the error doesnt accour:

    if not ServerSocketActive then
    OpenServerSocket(23);

    if ServerSocketActive then
    begin
    writeln('im a server');
    if ServerSocketHasClient then
    begin
    writeln('i have a client');
    repeat
    ReadServerSocket(s, #13#10);
    if s <> '' then
    begin
    writeln(s);
    WriteServerSocket(s);
    WriteServerSocket(#13#10);
    end;
    until s = '';
    end;
    end;


    Am i missing some kind of cleanup function for the 'ReadClientSocket' function?
     
    Serban, Jul 23, 2007
    #1
  2. Serban

    Christian

    Joined:
    Dec 20, 2004
    Messages:
    14
    Likes Received:
    0
    The Fix

    Just make the touch screen the server and the computer the client.

    This should fix your problem.
     
    Christian, Jul 26, 2007
    #2
  3. Serban

    Darren Senior Member

    Joined:
    Jul 29, 2004
    Messages:
    2,361
    Likes Received:
    0
    Location:
    Adelaide, South Australia
    There is a slow memory leak with the ReadClientSocket function. This will be fixed in the next version (don't ask when).
     
    Darren, Aug 6, 2007
    #3
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.