chat server script with broadcast_data function