• Socket communication problem

    From Pablo Javier Mur@21:1/5 to All on Wed Nov 4 19:31:27 2020
    Hi,
    I have 2 applications written in Dolphin SmallTalk 7.1.14 communicated by socket.

    To send data I use the following object:
    (STBOutFiler on: socket writeStream) that stays alive during all communication.

    To receive data I use the following object:
    ((STBValidatingInFiler on: socket readStream)
    validationBlock: [: className | true];
    yourself)
    which also stays alive throughout the connection.

    The problem is that applications can be connected for hours and objects are being sent all the time. The STBFiler objects have writeMap and readMap attributes respectively, which record all the objects that are received or sent, which causes them to
    accumulate thousands of instances that are not used but are not eliminated because they are referenced by those attributes. Eventually, at some point the apps go down. I am doing something wrong? I would appreciate if you can tell me if I should change
    something so as not to accumulate items that should be disposed of.
    Greetings and thank you very much.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From john.aspinall@gmail.com@21:1/5 to Pablo Javier Mur on Thu Nov 5 01:23:02 2020
    Hi Pablo,

    STB uses the writeMap and readMap to remember objects that have already been written/read. This ensures each object is only sent once, and that repeated writes of the same object on the sending side result in the exact same object on the receiving end,
    maintaining the identity of the object and thus the consistency of the overall object graph.

    It sounds as if you're more interested in sending individual packets of objects than an overall graph of objects that persists for the lifetime of your application. If this is the case I'd suggest creating a new STBOutFiler and STBInFiler for each write
    and read - something like this:

    "Write"
    (STBOutFiler on: socket writeStream) nextPut: objectToSend

    "Read"
    ((STBValidatingInFiler on: socket readStream)
    validationBlock: [: className | true];
    yourself) next

    Hope this helps.

    John


    On Thursday, November 5, 2020 at 3:31:28 AM UTC, Pablo Javier Mur wrote:
    Hi,
    I have 2 applications written in Dolphin SmallTalk 7.1.14 communicated by socket.

    To send data I use the following object:
    (STBOutFiler on: socket writeStream) that stays alive during all communication.

    To receive data I use the following object:
    ((STBValidatingInFiler on: socket readStream)
    validationBlock: [: className | true];
    yourself)
    which also stays alive throughout the connection.

    The problem is that applications can be connected for hours and objects are being sent all the time. The STBFiler objects have writeMap and readMap attributes respectively, which record all the objects that are received or sent, which causes them to
    accumulate thousands of instances that are not used but are not eliminated because they are referenced by those attributes. Eventually, at some point the apps go down. I am doing something wrong? I would appreciate if you can tell me if I should change
    something so as not to accumulate items that should be disposed of.
    Greetings and thank you very much.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Pablo Javier Mur@21:1/5 to All on Thu Nov 5 11:28:19 2020
    Hi John,

    Thank you very much for your answer, I will try creating a STBOutFiler and STBValidatingInFiler for each sending and receiving of messages.

    Bye

    El jueves, 5 de noviembre de 2020 a la(s) 06:23:03 UTC-3, john.a...@gmail.com escribió:
    Hi Pablo,

    STB uses the writeMap and readMap to remember objects that have already been written/read. This ensures each object is only sent once, and that repeated writes of the same object on the sending side result in the exact same object on the receiving end,
    maintaining the identity of the object and thus the consistency of the overall object graph.

    It sounds as if you're more interested in sending individual packets of objects than an overall graph of objects that persists for the lifetime of your application. If this is the case I'd suggest creating a new STBOutFiler and STBInFiler for each
    write and read - something like this:

    "Write"
    (STBOutFiler on: socket writeStream) nextPut: objectToSend

    "Read"
    ((STBValidatingInFiler on: socket readStream)
    validationBlock: [: className | true];
    yourself) next

    Hope this helps.

    John
    On Thursday, November 5, 2020 at 3:31:28 AM UTC, Pablo Javier Mur wrote:
    Hi,
    I have 2 applications written in Dolphin SmallTalk 7.1.14 communicated by socket.

    To send data I use the following object:
    (STBOutFiler on: socket writeStream) that stays alive during all communication.

    To receive data I use the following object:
    ((STBValidatingInFiler on: socket readStream)
    validationBlock: [: className | true];
    yourself)
    which also stays alive throughout the connection.

    The problem is that applications can be connected for hours and objects are being sent all the time. The STBFiler objects have writeMap and readMap attributes respectively, which record all the objects that are received or sent, which causes them to
    accumulate thousands of instances that are not used but are not eliminated because they are referenced by those attributes. Eventually, at some point the apps go down. I am doing something wrong? I would appreciate if you can tell me if I should change
    something so as not to accumulate items that should be disposed of.
    Greetings and thank you very much.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)