private BroadCaster() { // Save our hub context so we can easily use it // to send to its connected clients _hubContext = GlobalHost.ConnectionManager.GetHubContext <ReaderTrackerHub>(); _model = new TrackModel(); _trackInfoUpdated = false; // Start the broadcast loop _broadcastLoop = new Timer(BroadcastTrackInfo, null, _broadcastInterval, _broadcastInterval); }
public void UpdateTrackInfo(string x, string y) { var connection = Context.ConnectionId; TrackModel model = new TrackModel { ConnectionId = connection, XPos = x, YPos = y }; //Clients.AllExcept(connection).notifyClients(model); // Update the shape model within our broadcaster _broadcaster.UpdateTrackInfo(model); }
public void UpdateTrackInfo(TrackModel clientModel) { _model = clientModel; _trackInfoUpdated = true; }