pusher / pusher-websocket-dotnet

Pusher Channels Client Library for .NET
MIT License
112 stars 113 forks source link

affect other eventhandler after pusher connect. #54

Closed ha-family closed 4 years ago

ha-family commented 6 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(....) ..... } `

yuyenkan commented 5 years ago

sklib.OnConnection += new customEventHandler()

delegate event is without bracket

sklib.OnConnection += new customEventHandler

damdo commented 4 years ago

Closing as the suggested answer is the right fix for this example.