question

DeepakYogi-8192 avatar image
0 Votes"
DeepakYogi-8192 asked DeepakYogi-8192 edited

EngineIoClientDotNet in xamarin.form

Hello developers

I am using EngineIoClientDotNet package for send and receive string data.
I installed EngineIoClientDotNet package in PCL then implement code.

public void Messages()
{
try
{
string result = string.Empty;

              var socket = new Socket("wss://echo.websocket.org");
              socket.On(Socket.EVENT_OPEN, () =>
              {
                  socket.Send("hi", () =>
                  {
                      socket.Close();
                  });
              });
              socket.Open();
              //Receiving data
               var socket1 = new Socket("http://128.199.17.43:3000");
              socket1.On(Socket.EVENT_OPEN, () =>
              {
                  socket1.On(Socket.EVENT_MESSAGE, (data) =>
                  {
                      result =(string)data;
                  });
              });
              socket1.Open();
              string dd = result;
          }
          catch (System.Exception ex)
          {
          }
      }

but socket.Send not called.
Please guys guide me where i am wrong.

Thanks :)




dotnet-xamarin
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

0 Answers