Jump to content

wolfhelm

Inactive Member
  • Posts

    5
  • Joined

  • Last visited

  • Feedback

    0%

About wolfhelm

Informations

  • Gender
    Male
  • Country
    United Kingdom

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

wolfhelm's Achievements

Rookie

Rookie (2/16)

  • First Post
  • Conversation Starter
  • Reacting Well
  • One Month Later
  • Week One Done

Recent Badges

2

Reputation

  1. Can you show the advantages of raknet over epoll/libevent vversion of protocol in this case?
  2. I can't sleep and I'm just looking through your source code. As for the variable types, I see that you have changed the long dword etc. correctly. See that there are variables left such as time_t size_t which still depend on the architecture. I like the project, I wonder if I could help you with it. Do you have a discord server for this project where the community could gather?
  3. In my opinion, the linux implementation of epoll is better than the abstraction layer like libevent. When it comes to the server, we care about performance. If there is no macos client, I don't see any point in running the macos server. But of course, you can run it on macos for fun. As you mentioned kqueue should work on macos. In my tests, this epoll implementation is really fast. Logging into the server or changing the map is several times faster than in the bsd version. My version was also tested "in production", all with several hundred players on one ch. As for the strange behavior, I suspect the problem is the port to 64bit. I haven't checked your code yet, but in my case similar problems occurred when the 32bit source version uses long which is treated as 32bit. Where when transferred to 64 bit it is treated as a 64 bit variable. This occurs in many places, but you probably know it because without changing the protocol from long to int, you would not be able to connect to the server.
  4. If you want a better native version of the network stack for Linux, I can send it to you. I have a tested stack on epoll with 1k+ players. [Hidden Content] Epoll example version: #define __LIBTHECORE__ #include "stdafx.h" fdwatch *fdwatch_new() { fdwatch *fdw; CREATE(fdw, fdwatch, 1); fdw->fd = epoll_create1(0); if (fdw->fd == -1) { sys_err("%s", strerror(errno)); return nullptr; } CREATE(fdw->events, epoll_event, 256); return fdw; } void fdwatch_delete(fdwatch *fdw) { close(fdw->fd); free(fdw->events); free(fdw); } int32_t fdwatch_count(fdwatch *fdw) { int32_t num = epoll_wait(fdw->fd, fdw->events, 256, 0); if (num == -1) { fprintf(stderr, "%s\n", strerror(errno)); } return num; } void fdwatch_add_fd(fdwatch *fdw, socket_t fd, void *client_data) { TFDWatchData *data; CREATE(data, TFDWatchData, 1); data->client_data = client_data; data->fd = fd; epoll_event event{}; event.events = EPOLLIN | EPOLLOUT; event.data.ptr = data; if (epoll_ctl(fdw->fd, EPOLL_CTL_ADD, fd, &event)) { fprintf(stderr, "%s\n", strerror(errno)); } } void fdwatch_del_fd(fdwatch *fdw, socket_t fd) { epoll_ctl(fdw->fd, EPOLL_CTL_DEL, fd, nullptr); } int32_t fdwatch_check_event(fdwatch *fdw, socket_t fd, int32_t event_idx) { auto *data = (TFDWatchData *) fdw->events[event_idx].data.ptr; if (data->fd == fd) { return fdw->events[event_idx].events; } else { return 0; } } void *fdwatch_get_client_data(fdwatch *fdw, int32_t event_idx) { auto *data = (TFDWatchData *) fdw->events[event_idx].data.ptr; return data->client_data; } #ifndef __INC_LIBTHECORE_FDWATCH_H__ #define __INC_LIBTHECORE_FDWATCH_H__ #include <sys/epoll.h> struct fdwatch { socket_t fd; epoll_event *events; }; typedef struct FDWatchData { socket_t fd; void *client_data; } TFDWatchData; extern fdwatch *fdwatch_new(); extern void fdwatch_delete(fdwatch *fdw); extern int32_t fdwatch_check_event(fdwatch *fdw, socket_t fd, int32_t event_idx); extern void fdwatch_add_fd(fdwatch *fdw, socket_t fd, void *client_data); extern int32_t fdwatch_count(fdwatch *fdw); extern void *fdwatch_get_client_data(fdwatch *fdw, int32_t event_idx); extern void fdwatch_del_fd(fdwatch *fdw, socket_t fd); #endif
×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.