marcoallanda01 / IS23AM15

4 stars 2 forks source link

Game notyfing listeners #33

Closed GiuseppeBocci closed 1 year ago

GiuseppeBocci commented 1 year ago

When the Game notifies a listener, should it be done in a separate thread? ( or)if not in the game, should the listener call the method on the ServerCommunication (virtual view) in a different thread? PS: send to a client in tcp do not submit a new thread, in RMI yes

ingconti commented 1 year ago

just 2 notes: a) notifications are synchronous.. b) why you wok need separate threads? anyway You will go on the sole thread the manages network, for tcp...

PietroAmmaturo commented 1 year ago

Notifications are not sent asynchronously to allow for correct notification order. In RMI notifications are sent asynchronously to different clients but synchronously to the same client, to guarantee correct ordering.