3

I have a cross-platform Xamarin.Forms app (iOS and Android) which provides a specific service. This service code is in PCL part of the project and I want to use it on web client as well using my app as server. Is there a way to implement TCP server in the app which listens to incoming connections and provides with the service.

Do I have to use platform specific background services to run TCPListener? The server should only be running when the app is in foreground.

I have tried to look for answers over forums and got bits and pieces. All I need right now is right direction to go to:

Any kind of help is highly appreciated.

Cheers.

Umair M
  • 10,298
  • 6
  • 42
  • 74
  • I understand that I have to write platform specific implementation to use background services/tasks. Similarly System.Net.Sockets is only supported in platform specific projects. However can I write PCL implementation using background thread and Sockets PCL plugins I mentioned in question? I am not very experienced in multithreading, could you please provide a sample example :) – Umair M Oct 29 '17 at 15:25
  • And how do I get to know server IP (phone's IP) on client side (web application). Web page would however be running in same app through a web-view. – Umair M Oct 29 '17 at 15:27

0 Answers0