Click here to Skip to main content
14,209,923 members
Rate this:
Please Sign up or sign in to vote.
See more:
hi every one please any one tell me how can i create connection with websocket in our c# application.
Actually i want to implement Card payment system in our EPOS application.
so i need to create connection with websocket but i don't know how can i do it.

i also found one link of webscoket in c#
but i cannot understand it clearly.

This is the Websocket Connection URI:

wss://sc327v760000.test.connect.paymentsense.cloud/pac?token=d125c1d5-9062-4ec4-b4c0-6cb0a2490e95&api-version=v1&software-house-id=SC327V76&installer-id=SC327V76


I need to maintain that connection in our EPoS

in a background thread
i also get some information related to websocket but i dont know how can i implement it in our application.




"
whenever something arrives on that message, or you want to post a message

you just pass it on to the websocket client

ws.Send ("BALUS");

{
  "jsonrpc": "2.0",
  "method": "connectedTerminals",
  "id": 1
}



i'm a biggner please i wait for some one help

What I have tried:

i have found this code but i dont know how can i implete this in our application

using System;
using WebSocketSharp;

namespace Example
{
  public class Program
  {
    public static void Main (string[] args)
    {
      using (var ws = new WebSocket ("ws://dragonsnest.far/Laputa")) {
        ws.OnMessage += (sender, e) =>
            Console.WriteLine ("Laputa says: " + e.Data);

        ws.Connect ();
        ws.Send ("BALUS");
        Console.ReadKey (true);
      }
    }
  }
}
Posted
Updated 11-Jun-19 10:11am

1 solution

Rate this:
Please Sign up or sign in to vote.

Solution 1

   

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



Advertise | Privacy | Cookies | Terms of Service
Web06 | 2.8.190617.3 | Last Updated 11 Jun 2019
Copyright © CodeProject, 1999-2019
All Rights Reserved.
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100