iam new in websocket. I have created a console application in .net 4.5 framework and create a sample websocket client using library "WebSocketSharp". I have following code
using System;
using WebSocketSharp;
namespace WebsocketTest
{
class Program
{
public static void Main(string[] args)
{
try
{
using (var ws = new WebSocketSharp.WebSocket("ws://192.168.18.186:7884"))
{
Console.WriteLine("started");
ws.Connect();
ws.Send("START");
Console.ReadLine();
}
}catch(Exception ex)
{
Console.WriteLine(ex.Message);
Console.ReadLine();
}
}
}
}
But i cant create a connection to my websocket server running on another machine. I got error message like this
09-05-2017 16:20:41|Fatal|WebSocket.connect:0|System.Net.Sockets.SocketException (0x80004005): No connection could be made because the target machine actively refused it 192.168.18.186:7884
at System.Net.Sockets.TcpClient..ctor(String hostname, Int32 port)
at WebSocketSharp.WebSocket.setClientStream()
at WebSocketSharp.WebSocket.doHandshake()
at WebSocketSharp.WebSocket.connect()
What is the issue related with my code? is any good websocket libraries are available?