Hi, I'm almost done a bomberman client for an AI hackathon, I just need to 
get the TCP input to run in it's own thread.

I have the following code:

include("bomberman.jl")

try
        GAMEIP = "0.0.0.0"
        GAMEPORT = 40000
        player = Player(GAMEIP, GAMEPORT)

        print(typeof(player), "\n")
        @async begin
                recv_update(player)
        end
        while true
                print(player.data)
        end

catch err
        print("connection ended with error $err\n")
end


Basically the recv_update(player) is running an infinite loop that updates 
the player.data properly.


My understanding is that Julia passes all values by reference so player should 
be getting updated outside of recv_update. Ignorantly I could ask, does @async 
use memory on a different process so it doesn't get updated?


If you need to see the recv_update() code I can paste it or you can go to 
https://github.com/collinglass/bombermanjl.



Regards,


Collin

Reply via email to