profile
viewpoint
If you are wondering where the data of this site comes from, please visit https://api.github.com/users/lsalzman/events. GitMemory does not store any data, but only uses NGINX to cache data for a period of time. The idea behind GitMemory is simply to give users a better reading experience.

lsalzman/enet 1954

ENet reliable UDP networking library

lsalzman/iqm 183

Inter-Quake Model format development kit

lsalzman/tesseract 179

Tesseract - repo moved to http://tesseract.gg

briantrice/slate-language 130

The Slate programming language

q66/OF-Engine 12

Do not use. Use OctaForge/OF-Engine

deathstar/QServCollect 7

Cube 2: Sauerbraten Server Mod for the older Collect Edition.

lsalzman/moz-skia 5

Branch of Google's Skia modified for interoperability with Mozilla Firefox

jrmuizel/sw-wr 3

A software renderer for WebRender

issue commentlsalzman/enet

Independant server loop lag?

Make sure that you're sending data to all clients before you go back into the service loop, rather than sending to one client, then servicing, sending to another client, then servicing, etc... So:

while (true) { while(service() > 0) { ... } for(client : clients) { doSomething(client); } }

There are further high performance tricks beyond this, but the basics should still work acceptably if done correctly.

tree786

comment created time in a month

issue commentlsalzman/enet

Improving/Updating the CMakeLists.txt

I'd be willing to revisit the CMake support, but I would like to avoid gigantic gestalt PRs that are all-or-nothing. Let's first decide on the minimum necessary quality-of-life improvements to keep the CMake support functional, and then we can decide about nice-to-haves.

Spirrwell

comment created time in a month

push eventlsalzman/SDL

Lee Salzman

commit sha c7094911bd4476933341ed83dca91017887ab123

Treat empty SDL_VIDEODRIVER var to check all video drivers.

view details

push time in 2 months

PR opened libsdl-org/SDL

Restore previous behavior of empty SDL_AUDIODRIVER trying all drivers.

The recent change to make SDL_AUDIODRIVER support comma-separated lists broke the previous behavior where an SDL_AUDIODRIVER that was empty behaved the same as if it was not set at all. This old behavior was necessary to paper over differences in platforms where SDL_setenv may or may not actually delete the env var if an empty string is specified. This patch just adds a simple check to ensure SDL_AUDIODRIVER is not empty before using it, restoring the old interpretation of the empty var.

<!--- Provide a general summary of your changes in the Title above -->

Description

<!--- Describe your changes in detail -->

Existing Issue(s)

<!--- If it fixes an open issue, please link to the issue here. -->

+1 -1

0 comment

1 changed file

pr created time in 2 months

push eventlsalzman/SDL

Lee Salzman

commit sha b58d84900beedc5d5a0ed0d3137ebdce06130932

Restore previous behavior of empty SDL_AUDIODRIVER trying all drivers. The recent change to make SDL_AUDIODRIVER support comma-separated lists broke the previous behavior where an SDL_AUDIODRIVER that was empty behaved the same as if it was not set at all. This old behavior was necessary to paper over differences in platforms where SDL_setenv may or may not actually delete the env var if an empty string is specified. This patch just adds a simple check to ensure SDL_AUDIODRIVER is not empty before using it, restoring the old interpretation of the empty var.

view details

push time in 2 months

fork lsalzman/SDL

Simple Directmedia Layer

https://libsdl.org

fork in 2 months

issue commentlsalzman/enet

'cannot create regular file' Build issue on manjaro

No idea, really. You can try doing an autoreconf -vfi to rebuild the configure setup with a newer autoconf if necessary and see if that helps at all.

tree786

comment created time in 2 months

issue closedlsalzman/enet

Trying to figure out how to make a basic echo server

I've been trying to figure out enet for some days now, reading the tutorial, but I'm having a hard time trying to get it working.

I'm trying to make a basic echo stuff, in a single file, just to see if I'm able to create a server, connect to it and send a message, nothing fancy. It's not working.

I'll leave all the code bellow. For your information, I'm having no errors or exception. It simply doesn't Log anything in the console... from my understanding, it was supposed to log that the client connected at least (or return a NULL peer, I guess?)

Initialization:

if (enet_initialize() != 0)	{
	throw std::exception("Enet failed to init ENet.");
}

// Server address:
ENetAddress address;
address.host = ENET_HOST_ANY;
address.port = 1234;

// Server:
m_server = enet_host_create(&address, 32, 2, 0, 0);
if (m_server == NULL) {
	Log("Error: Falied to create server.");
}

// Client:
m_client = enet_host_create(NULL, 1, 2, 0, 0);
if (m_client == NULL) {
	Log("Error: Falied to create client.");
}

// Connecting to the server:
m_clientPeer = enet_host_connect((ENetHost*)m_client, &address, 2, 0);
if (m_clientPeer == NULL) {
	Log("Error: Falied to connect to server.");
}

in the Gameloop...

ENetHost* server = (ENetHost*)m_server;
ENetHost* client = (ENetHost*)m_client;


// an UI button on my interface to send a message...
if (ui::Button("Send a test message")) {
	ENetPacket * packet = enet_packet_create("packet",
		strlen("packet") + 1,
		ENET_PACKET_FLAG_RELIABLE);
	enet_peer_send((ENetPeer*)m_clientPeer, 0, packet);
}

// Handle the Server inputs
{
	ENetEvent event;
	while (enet_host_service(server, &event, 0) > 0) {
		if (event.type == ENET_EVENT_TYPE_CONNECT) {
			Log("Server: A new client connected!");
		}
		else if (event.type == ENET_EVENT_TYPE_RECEIVE) {	
			// Echo:
			ENetPacket * packet = enet_packet_create(
				event.packet->data, event.packet->dataLength,
				ENET_PACKET_FLAG_RELIABLE
			);
			enet_peer_send((ENetPeer*)event.peer, 0, packet);

			Log("Server: New client message!");
		}
		else if (event.type == ENET_EVENT_TYPE_DISCONNECT) {
			Log("Server: A client disconnected!");
		}
	}
}

// Handle the Client inputs
{
	ENetEvent event;
	while (enet_host_service(client, &event, 0) > 0) {
		if (event.type == ENET_EVENT_TYPE_CONNECT) {
			Log("Client: A new client connected!");
		}
		else if (event.type == ENET_EVENT_TYPE_RECEIVE) {
			Log("Client: New client message!");
		}
		else if (event.type == ENET_EVENT_TYPE_DISCONNECT) {
			Log("Client: A client disconnected!");
		}
	}
}

Shutdown

if (m_clientPeer) {
	enet_peer_disconnect((ENetPeer*)m_clientPeer, 0);
}

if (m_client) {
	enet_host_destroy((ENetHost*)m_client);
}

if (m_server) {
	enet_host_destroy((ENetHost*)m_server);
}

enet_deinitialize();

closed time in 2 months

UnidayStudio

issue commentlsalzman/enet

Trying to figure out how to make a basic echo server

That won't work as you have written it. It's best to think of the connection handshake of having an indeterminate amount of interleaved stages, so if you only service the server, then the client, then exit, the handshake for the connection will never have the opportunity to finish.

UnidayStudio

comment created time in 2 months

issue closedlsalzman/enet

Question about enet_host_service timeout and ENet configuration

Hello, I wanted to ask if there are different types of recommendations on which timeout to choose depending on what I am going to do (e.g does/should the timeout and perhaps other ENet configurations be modified to get better latency or better throughput for a game?)

I want to know every tip in advance to squeeze the most out of ENet, for best latency and throughput, for example:

  • When should I rather use a low timeout (< 1000ms) or a "high" timeout (e.g 6000 ms)
  • Will playing around with MTU help boost retransmission when packets are small?
  • Are there any other modifications that could be done to ENet that would fit fast paced game rather than some "standardish" service

Thanks!

closed time in 2 months

playingoDEERUX

issue commentlsalzman/enet

Question about enet_host_service timeout and ENet configuration

Timeouts and retransmission are the enemy in and of themselves, so the goal is always to use unreliable packets, rather than reliable ones, since they have neither of those.

playingoDEERUX

comment created time in 2 months

push eventlsalzman/moz-skia

Lee Salzman

commit sha b18f5b2ffde5cc6d321b428adac5a91d33fd7131

Bug 1711553 - Avoid use of GetRecommendedRenderingMode in Skia

view details

push time in 2 months

issue commentlsalzman/enet

Windows clients disconnect en masse

It sounds like you are no longer properly servicing the host and things time out because you haven't resumed doing so before the timeout period.

On Thu, Jul 22, 2021 at 7:18 AM Elliot Ayrey ***@***.***> wrote:

Hey there,

I've been making a basic chat application using the code snippets provided in the tutorial and it mostly works great, but I've come across a strange problem:

When I have multiple clients connected to a server, if one of the clients initiates a disconnect, then other clients will be disconnected by the server shortly after.

I have narrowed it down to this code block that is issuing the disconnect.

static int enet_protocol_check_timeouts (ENetHost * host, ENetPeer * peer, ENetEvent * event) { ...

   if (peer -> earliestTimeout != 0 &&
         (ENET_TIME_DIFFERENCE (host -> serviceTime, peer -> earliestTimeout) >= peer -> timeoutMaximum ||
           (outgoingCommand -> roundTripTimeout >= outgoingCommand -> roundTripTimeoutLimit &&
             ENET_TIME_DIFFERENCE (host -> serviceTime, peer -> earliestTimeout) >= peer -> timeoutMinimum)))
   {
      enet_protocol_notify_disconnect (host, peer, event);

      return 1;
   }

The odd thing is this only happens to windows clients. Specifically, if I have 4 clients connected to a server, 2 on windows and 2 on linux, if one of the windows clients disconnects, all other windows clients will be forcefully disconnected by the server - the linux clients are unaffected.

Just wondering if anyone knows what could be the cause of this? I plan on digging a bit deeper at some point but figured I would report it in case anyone else was encountering something similar.

Cheers!

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/lsalzman/enet/issues/165, or unsubscribe https://github.com/notifications/unsubscribe-auth/AALDVUKJNEITMOYBICNWMP3TY747NANCNFSM5AZZL2DA .

illej

comment created time in 3 months