diff --git a/HubConnectionOptions.go b/HubConnectionOptions.go index 0274947..f24e668 100644 --- a/HubConnectionOptions.go +++ b/HubConnectionOptions.go @@ -11,7 +11,7 @@ type HubConnectionOptions struct { NumEventsToBuffer uint // Returning messages in sync mode - OnEventSync func(HubEvent) + OnEventSync func(*HubConnection, HubEvent) } func (this *HubConnectionOptions) prepareConnection() *HubConnection { @@ -54,5 +54,9 @@ func (this *HubConnectionOptions) Connect() *HubConnection { // Client code should supply an event handling function as hco.OnEventSync. func (this *HubConnectionOptions) ConnectSync() { hc := this.prepareConnection() + hc.OnEvent = nil + hc.processEvent = func(ev HubEvent) { + this.OnEventSync(hc, ev) + } hc.worker() }