mail socket scope in web app

  1. 5 weeks ago

    Hey.. I am experimenting with a multi user web app... So I was wondering, if I want to send a mail from the app, the socket should be a property of the app or the session ?
    I've seen some examples where the mail socket belongs to the app, but what happens in that case if two users want to send an email at the same time ?

    thanks
    Roman

  2. Louis D

    Jan 21 Pre-Release Testers, Xojo Pro Montreal, QC, Canada

    Actually, the socket should probably be a property of the page, container or dialog. The page being in the context of the session, you still have a unique socket for each user/process.

  3. If I set the socket as a property of the page, I risk getting it out of scope if the user moves away from the page

  4. 4 weeks ago

    Louis D

    Jan 22 Pre-Release Testers, Xojo Pro Montreal, QC, Canada
    Edited 4 weeks ago

    I would suppose that if there is a need to send an email from another page, i would create another socket for that page. - That is the way my own aps are structured. A socket is open only as long as required. It is therefore only in scope of the current process.

    Incidently, I use very few pages and instead embed containers as needed. My mail sockets are properties of the webcontainers. Each container is associated with a specific process step and so sockets are also specific and short lived.

  5. Tim P

    Jan 22 Pre-Release Testers feedback://46303

    @Roman V If I set the socket as a property of the page, I risk getting it out of scope if the user moves away from the page

    I was surprised to find out that this isn't quite true. If you're opening webpages dynamically rather than using implicit instance, they stay open forever unless explicitly closed. The general design philosophy I used once ended up with tons of webpages still existing in memory. Showing a new page doesn't implicitly close the one the user is on.

  6. Christian S

    Jan 23 Pre-Release Testers, Xojo Pro, XDC Speakers Germany

    webpages are kept in memory for the session until you close the page or the session.

    in a web app:
    app and module properties, all shared properties, static variables -> global for all users
    properties on session, web pages, controls, local variables -> local per user

or Sign Up to reply!