Closed ha-family closed 4 years ago
i have some problem, my custom event handler won't fire after pusher connect. i don't know why, but once i mark the line "_pusher.Connect()" then everything went well again. can't anyone help me?? is that caused by thread??
` void InitPusher() { _pusher = new Pusher("KEY", new PusherOptions(){ Cluster = 'ap1' }); _pusher.ConnectionStateChanged += _pusher_ConnectionStateChanged; _pusher.Error += _pusher_Error; _pusher.Connect(); }
private void btn_click(object sender, EventArgs e) { sklib.OnConnection += new customEventHandler() }
void sklib_OnConnection(int code) { if(....) ..... } `
sklib.OnConnection += new customEventHandler()
delegate event is without bracket
sklib.OnConnection += new customEventHandler
Closing as the suggested answer is the right fix for this example.
i have some problem, my custom event handler won't fire after pusher connect. i don't know why, but once i mark the line "_pusher.Connect()" then everything went well again. can't anyone help me?? is that caused by thread??
` void InitPusher() { _pusher = new Pusher("KEY", new PusherOptions(){ Cluster = 'ap1' }); _pusher.ConnectionStateChanged += _pusher_ConnectionStateChanged; _pusher.Error += _pusher_Error; _pusher.Connect(); }
private void btn_click(object sender, EventArgs e) { sklib.OnConnection += new customEventHandler() }
void sklib_OnConnection(int code) { if(....) ..... } `