Click here to Skip to main content
15,891,136 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi I have C# socket in my C# where I log in to a server and subscribe to an event that provides constant data. When my code tries to send a command to the server sometimes the server receives the message and other times not. I suspect this may be due to messages from the event and the messages from the command being sent interfering with each other. I am just trying to see if there are things I might try to try and have all the sent commands be received by the server regardless of the event's activity.

What I have tried:

Tried sending CMD command in response to event updates to no avail in C#.
Posted
Comments
Richard MacCutchan 27-Sep-21 15:05pm    
You need to show the code that is causing the problem, and more specific details around the problem. No one here can possibly guess what may be happening.
Admin BTA 27-Sep-21 15:42pm    
socket.eventPool.Subscribe("temp", new EventHandler<args>((i, p) =>
{
ts[cur] = p.temp;

if (somebool?)
{
socket.sendcommand;
}
}


In the above, the sendcommand only gets to the server about 50% of the time. I want it to go through 100%.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900