public WebSocket(PushBulletClient client, PushBulletClientConfig config, JsonSerializer serializer) { _socket = new CasinoSocket(); _socket.MessageReceived += MessageReceived; _client = client; _config = config; _serializer = serializer; }
public RequestClient(PushBulletClient client, PushBulletClientConfig config, JsonSerializer serializer) { _client = client; _http = new HttpClient { BaseAddress = new Uri(config.ApiBaseUrl) }; _http.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json")); _http.DefaultRequestHeaders.Add("Access-Token", config.Token); _serializer = serializer; _semaphore = new SemaphoreSlim(1, 1); }