Call to a specific Client (using Invoke) fails in SignalR - conversion issue -


can explain me why second call (to individual client) invalid?

ihubcontext hubcontext = globalhost.connectionmanager.gethubcontext<symhubgrid>();  ((clientproxy)(hubcontext.clients.all)).invoke(method, msg);   // ok  ((clientproxy)(hubcontext.clients.client(hubconnid))).invoke(method, msg);  // fail 

it fails following exception:
{microsoft.csharp.runtimebinder.runtimebinderexception: cannot convert type 'microsoft.aspnet.signalr.hubs.connectionidproxy' 'microsoft.aspnet.signalr.hubs.clientproxy

it connected earlier post.

thanks

share|improve question

you don't need cast clientproxy in order call invoke off of it. hubcontext.clients.all.invoke( method, msg ) need. actually, don't need invoke @ all, hubcontext.clients.all.method( msg );

share|improve answer
    
thanks need cast somehow can call invoke. need since don't know method call until runtime - please see me earlier related post. – marcel apr 18 '13 @ 19:24
    
have tried bare invoke without cast? looked @ signalr code , invoke( method, msg ) should work. – joel lucsy apr 18 '13 @ 19:30
    
looking @ other question, stackoverflow.com/a/16090685/645 looks right. – joel lucsy apr 18 '13 @ 19:32
    
you right - posted! – marcel apr 18 '13 @ 19:54

oeps - found answer - need cast iclientproxy - not actual proxy!

thanks halter73 in post:

it works fine this: (note iclientproxy!)

ihubcontext hubcontext = globalhost.connectionmanager.gethubcontext<symhubgrid>();  ((iclientproxy)(hubcontext.clients.all)).invoke(method, infodown);  ((iclientproxy)(hubcontext.clients.client(hubconnid))).invoke(method, infodown); 
share|improve answer

your answer

 
discard

posting answer, agree privacy policy , terms of service.

not answer you're looking for? browse other questions tagged or ask own question.

Comments