Forum Libraries, Components, and Plugins

rda.SocketsForPCL + The empty PCL implementation for Sockets was loaded

i installed the package rda.SocketsForPCL.2.0.2 with NuGet in my Project. If i run the following code i get the exception:

System.NotImplementedException: The empty PCL implementation for Sockets was loaded. Ensure you have added the Sockets nuget package to each of your platform projects.
04-14 18:30:09.442 I/MonoDroid( 3840): at Sockets.Plugin.TcpSocketClient..ctor () [0x00006] in C:\Users\rdavis\Source\Repos\sockets-for-pcl-for_real\Sockets\Sockets.Plugin\TcpSocketClient.cs:22

var client = new Sockets.Plugin.TcpSocketClient(); 
await client.ConnectAsync(address, port);

I develop a App with Xamarin Forms (v. for Android 7.1 and iOS.

How i can solve this Problem?





  • mattwardmattward GBMember Xamurai

    Did you install the rda.SocketsForPCL NuGet package into your iOS and Android projects? The error suggests that it was only installed into the PCL project.

  • hola amigos, Disculpen quiero enviar unas coordenadas geográficas, Latitud y Longitud a un servidor pero he intentado varias cosas, y no puedo hacerlo aun,

    for (int i = 0; i < 5; i++)
    // write to the 'WriteStream' property of the socket client to send data
    var nextByte = (byte)r.Next(0, 254);
    await client.WriteStream.FlushAsync();
    //Este codigo es para obtener las coordenas, no se como proclamarle para enviar al servidor las coordenas
    var locator = CrossGeolocator.Current;
    locator.DesiredAccuracy = 50;
    var position = await locator.GetPositionAsync(TimeSpan.FromSeconds(3));
    Longitudlbl.Text = position.Longitude.ToString();
    Latitudlbl.Text = position.Latitude.ToString();
    // wait a little before sending the next bit of data

                await Task.Delay(TimeSpan.FromMilliseconds(500));
Sign In or Register to comment.