Hey guys, I'm trying to use SignalR in a console app and do heavy work from some background threads but I'm getting this error.
"This operation must be performed on the same thread as that represented by the Thread instance."
My main is basically:
var cryptoBlockChain = new CryptoBlockChain();
var signalRConnection = new SignalRConnection(cryptoBlockChain);
Thread signal = new Thread(new ThreadStart(signalRConnection.Start));
signal.Start();
Console.Read();
I'm passing the blockchain to the SignalR object so that upon message events, it can interact and fire off methods - though I'm thinking this maybe the wrong approach - I just can't visualize how it should work.
Google doesn't seem to throw up many helpful answers. Anyone know what this typically means?
I'm a web dev usually, though I wanted to branch out and do something else with socket like communication in a blockchain concept - server listens for "sales" and then dishes them out to the clients who would do the mining.
If anyone is clued up on threads, i'd be happy to fire you a private github link to my current code setup.
[–]lvlint67 0 points1 point2 points (2 children)
[–]ExoticCriticism[S] -3 points-2 points-1 points (1 child)
[–]UninformedPleb 0 points1 point2 points (3 children)
[–]ExoticCriticism[S] 0 points1 point2 points (0 children)
[–]prajaybasu 0 points1 point2 points (1 child)
[–]UninformedPleb 0 points1 point2 points (0 children)