You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have this quite elegant code that just sends data on a socket and should invoke an event when it receives a response on a socket it should be listening to.
My issue with this code is with WinForms and Xamarin.Forms (UI frameworks) where some threading is interfering with the "send to socket" method.
UPDATE 9. March
Thanks to LimGeomJe the ServiceConsole is now updated and can receive data from the client so the problem is why the client can't receive data back from the service
But sending data doesn't seem to work when in a UI environment it seems.
What works
Set ServerConsole and ClientConsole programs as startup and just pres F5.
And we get results flowing between them (I know I need to fix something there but It doesn't matter if I can't get this to work in an UI app)
So the code works logicly at least...
What doesn't work
If I set the Android project as a startup project and run the emulator and run ServiceConsole (Debug->Start new instance ) I can connect (press connect top right) to the service like you see here
But when I try to send data it does seem to be able to write to the socket (even though it never shows up in the ServiceConsole. See Client.SenderSendData method code
And probably because it can't write over to the server it can never get a response in the Receiver code that runs and runs. So the problem seems to be with the Send. See ClientReceiver code
When I then check the _stream properties I can see the port 14000 but the IP address is 33685514 that translates to 2.2.0.10 (not 10.0.2.2) according to this page. I don't know if that's anything...
My BOUNTY questions
Why NetworkStream seem to be writing to the stream without sending the data to ServiceConsole, only when in a UI framework (Xamarin or WinForms)
How can I send data to the service and receive data back with this architecture?
I need this alert to fire always when a new data is sent from the client.
Get this to work with the WinForms code could also help and will be awarded the bounty if nobody solved the Xamarin part.
Please don't be shy to try this code out for yourself.
The text was updated successfully, but these errors were encountered:
What is this?
I have this quite elegant code that just sends data on a socket and should invoke an event when it receives a response on a socket it should be listening to.
My issue with this code is with WinForms and Xamarin.Forms (UI frameworks) where some threading is interfering with the "send to socket" method.
UPDATE 9. March
Thanks to LimGeomJe the ServiceConsole is now updated and can receive data from the client so the problem is why the client can't receive data back from the service
Usage
How I use the code in my ItemsPage
But sending data doesn't seem to work when in a UI environment it seems.
What works
Set ServerConsole and ClientConsole programs as startup and just pres F5.
And we get results flowing between them (I know I need to fix something there but It doesn't matter if I can't get this to work in an UI app)
So the code works logicly at least...
What doesn't work
If I set the Android project as a startup project and run the emulator and run ServiceConsole (Debug->Start new instance ) I can connect (press connect top right) to the service like you see here
But when I try to send data it does seem to be able to write to the socket (even though it never shows up in the ServiceConsole. See Client.SenderSendData method code
And probably because it can't write over to the server it can never get a response in the Receiver code that runs and runs. So the problem seems to be with the Send. See ClientReceiver code
When I then check the _stream properties I can see the port 14000 but the IP address is 33685514 that translates to 2.2.0.10 (not 10.0.2.2) according to this page. I don't know if that's anything...
My BOUNTY questions
Please don't be shy to try this code out for yourself.
The text was updated successfully, but these errors were encountered: