Exemple #1
0
        public async void Init()
        {
            // first get users...
            _hub = new CowHub(Url);
            _hub.UsersResponse += _hub_UsersResponse;
            await _hub.Connect();

            //var clientId =  _hub.ClientId;

            _hub.SendItemType(EnumItemType.users);
        }
Exemple #2
0
        private async void btnConnect_Click(object sender, EventArgs e)
        {
            var url = tbUrl.Text;

            _hub = new CowHub(url);
            _hub.StateChanged     += StateChanged;
            _hub.BroadcastMessage += BroadcastMessage;
            _hub.UserConnected    += UserConnected;
            _hub.UserReconnected  += UserReconnected;
            _hub.UserDisconnected += UserDisconnected;
            _hub.UsersResponse    += _hub_UsersResponse;
            _hub.ProjectsResponse += _hub_ProjectsResponse;
            _hub.PeersResponse    += _hub_PeersResponse;
            _hub.GroupsResponse   += _hub_GroupsResponse;
            _hub.ItemsResponse    += _hub_ItemsResponse;

            await _hub.Connect();

            AddLog("SignalR connected");
            AddLog("SignalR connection id:" + _hub.ClientId);
            AddLog("SignalR transport mode:" + _hub.TransportName);
        }