Goal
Send and receive message from TCP socket on two different threads in a UI program.
Problem
I can't connect to a socket and send/receive data ONLY when I'm in Xamarin.Forms and WinForms. So this is some kind of a threading issue.
When I try connecting it just times out here so there is no error or nothing.
What I have been trying
I have been working heavily with Matt Davis solution here on StackOverflow.
I created a test code (TcpClientSendReceive) at GitHub with all the code needed.
My code
Its all on GitHub in this repository. I cant fit it all in here. But here is the connection code that does not seem to work with e.g Xamarin.Forms see that code here.
If I try to connect to my console server from a UI I can't connect (witch means that I can´t either send/receive)
Does the baseline code work?
Yes it does. At least when I run the two Client/Server programs it sends data between each other.
What could be the problem?
Definitely how threading is setup and how it interacts with the UI. I'm just lacking enough threading experience to be able to figure this out. I hope some of you do! :-)
EDIT:
BOUNTY INFORMATION
I created a more detailed bounty information page on GitHub so it would be totally clear what I needed.
I added LOTS of images and links to code. It should be very easy to get the code and just try it out. Please try it out. I really don´t think this is a big issue for somebody lower level than me.