Skip to content

juanluelguerre/SocketIo.Core

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Socket.Io.Core

SocketIo.Core

Abstraction of TCP/UDP sockets that writes like Socket.IO

Example

bool hit1 = false;
bool hit2 = false;


var socket = Io.Create("127.0.0.1", 4533, 4533, SocketHandlerType.Udp);

socket.On("connect", () =>
{
	hit1 = true;
	socket.On("test", (int package) =>
	{
		if (package == 5)
		{
			hit2 = true;
		}
	});

	socket.Emit("test", 5);

});

socket.Emit("connect");

int timer = 0;
int timeout = 5000;
while ((!hit1 || !hit2)
	&& timer < timeout)
{
	Thread.Sleep(100);
	timer += 100;
}
socket.Close();

Assert.IsTrue(hit1 && hit2);

About

Socket.Io for .Net Core

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C# 99.9%
  • Batchfile 0.1%