summaryrefslogtreecommitdiff
path: root/src/network/core/os_abstraction.h
AgeCommit message (Collapse)Author
2021-06-15Codechange: [Network] Let NetworkError return its std::string instead of a ↵rubidium42
C-string
2021-05-24Fix: Network on Haiku, remove old code for BeOSmilek7
2021-05-01Codechange: move some OS abstraction method implementations out of the headerrubidium42
2021-05-01Codechange: encapsulate network error handlingrubidium42
2021-04-27Change: [Network] lower TCP connect() timeout to 3s (#9112)Patric Stout
Currently we use default OS timeout for TCP connections, which is around 30s. 99% of the users will never notice this, but there are a few cases where this is an issue: - If you have a broken IPv6 connection, using Content Service is first tried over IPv6. Only after 30s it times out and tries IPv4. Nobody is waiting for that 30s. - Upcoming STUN support has several methods of establishing a connection between client and server. This requires feedback from connect() to know if any method worked (they have to be tried one by one). With 30s, this would take a very long time. What is good to mention, is that there is no good value here. Any value will have edge-cases where the experience is suboptimal. But with 3s we support most of the stable connections, and if it fails, the user can just retry. On the other side of the spectrum, with 30s, it means the user has no possibility to use the service. So worst case we annoy a few users with them having the retry vs annoying a few users which have no means of resolving the situation.
2021-04-27Change: [Network] Use string error messages instead of numeric error numbers ↵rubidium42
that need to be looked up
2021-04-27Fix: [Network] errno and strerror do not handle network errors on Windowsrubidium42
2020-12-27Codechange: Replace assert_compile macro with static_assertCharles Pigott
2020-12-15Fix: workarounds for two emscripten bugs in the network stackPatric Stout
2020-12-15Add: support for emscripten (play-OpenTTD-in-the-browser)Patric Stout
Emscripten compiles to WASM, which can be loaded via HTML / JavaScript. This allows you to play OpenTTD inside a browser. Co-authored-by: milek7 <me@milek7.pl>
2019-11-10Cleanup: Removed SVN headersS. D. Cloudt
2019-10-07Fix: [Cygwin] Fix missing AI_ADDRCONFIG declarationJoe Stringer
Fixes the following complaints: src/network/core/address.cpp: In member function 'const sockaddr_storage* NetworkAddress::GetAddress()': src/network/core/address.cpp:134:55: error: 'AI_ADDRCONFIG' was not declared in this scope this->Resolve(this->address.ss_family, SOCK_STREAM, AI_ADDRCONFIG, nullptr, ResolveLoopProc); Signed-off-by: Joe Stringer <joe@wand.net.nz>
2019-03-20Remove: ENABLE_NETWORK switchPatric Stout
This switch has been a pain for years. Often disabling broke compilation, as no developer compiles OpenTTD without, neither do any of our official binaries. Additionaly, it has grown so hugely in our codebase, that it clearly shows that the current solution was a poor one. 350+ instances of "#ifdef ENABLE_NETWORK" were in the code, of which only ~30 in the networking code itself. The rest were all around the code to do the right thing, from GUI to NewGRF. A more proper solution would be to stub all the functions, and make sure the rest of the code can simply assume network is available. This was also partially done, and most variables were correct if networking was disabled. Despite that, often the #ifdefs were still used. With the recent removal of DOS, there is also no platform anymore which we support where networking isn't working out-of-the-box. All in all, it is time to remove the ENABLE_NETWORK switch. No replacement is planned, but if you feel we really need this option, we welcome any Pull Request which implements this in a way that doesn't crawl through the code like this diff shows we used to.
2019-03-05Fix: warnings when compiling for a recent version of HaikuPatric Stout
This might break older Haiku versions, but it is hard to tell.
2019-03-05Remove: BeOS support (deprecated by Haiku)Patric Stout
In 10 years there is no commit to change how BeOS works, and we have no active maintainer for it. It is unlikely it works in its current state (but not impossible). With the arrival of SDL2 (and removal of SDL), BeOS is no longer support. SDL2 suggests to use Haiku instead of BeOS.
2019-03-05Remove: MorphOS / AmigaOS supportPatric Stout
In 10 years there is no commit to change how MorphOS works, and we have no active maintainer for it. It is unlikely it works in its current state (but not impossible). With the arrival of SDL2 (and removal of SDL), MorphOS is no longer support. There is an SDL2 port for MorphOS, but it is not maintained by upstream SDL2, and nobody can currently test it out. If anyone wants to re-add MorphOS, please do (revert this patch, fix the problems, and create a Pull Request). If you need any help doing so, let us know! It is not that we don't like MorphOS, it is that we don't have anyone fixing the problems :(
2019-01-17Codechange: Remove unnecessarily defined functions under MinGWCharles Pigott
2018-12-27Fix: [Win32] WIN32 may not be defined, always prefer the compiler predefined ↵glx
macro _WIN32
2018-04-29Remove: PSP supportPatric Stout
2014-12-24(svn r27092) -Fix/Add [FS#6186]: Compilation on OS/2 (smedles)frosch
2012-10-04(svn r24571) -Fix: do not cast away construbidium
2011-05-01(svn r22403) -Document: some more network/core coderubidium
2010-06-28(svn r20030) -Fix: MSVC 2010 defines more POSIX error constants that we ↵michi_cc
define as well.
2010-05-10(svn r19781) -Fix [FS#3809]: compilation on NetBSD failed (Krille)rubidium
2010-02-10(svn r19090) -Codechange: some comment coding style fixesrubidium
2010-01-16(svn r18834) -Fix [FS#3538]: compilation failed on OpenBSD (matze)rubidium
2009-09-21(svn r17606) -Add: initial support for Haiku; a dedicated server with zlib ↵rubidium
and libpng compiles and links (for me). Something's fishy with the network so it doesn't actually work (yet)
2009-09-01(svn r17350) -Fix (r17336): broken compilation with mingwglx
2009-08-21(svn r17248) -Fix: add GPL license notice where appropriaterubidium
2009-08-14(svn r17168) -Codechange: apply coding style to if and while statementssmatz
2009-04-12(svn r16050) -Fix (r15933): little typo causing OTTDfreeaddrinfo to use the ↵glx
fallback even when freeaddrinfo is available
2009-04-08(svn r15993) -Codechange: clean up/generalise the handling of the server listrubidium
2009-04-03(svn r15945) -Fix (r15944): win32 compilationglx
2009-04-03(svn r15933) -Fix (r15920): mingw doesn't know getaddrinfo() and ↵glx
freeaddrinfo() either
2009-04-02(svn r15919) -Fix (r15916): mingw doesn't know getnameinfo() (unless you ↵glx
compile for XP SP2+). Also fix a MSVC warning.
2009-03-15(svn r15718) -Cleanup: apply some comment coding style on the rest of the ↵rubidium
sources too
2008-08-25(svn r14177) -Fix: define INADDR_NONE only when it hasn't been defined yetsmatz
2008-04-30(svn r12930) -Add: build support for NetBSD and HP-UX. Patch by ahoka.rubidium
2007-11-19(svn r11480) -Codechange: Rename the function ALIGN fitting to the naming styleskidd13
This fixes also FS#1450
2007-04-18(svn r9672) -Cleanup: lots of coding style fixes around operands.rubidium
2007-02-23(svn r8857) -Documentation: Added some doxygen @file tags, repaired others ↵celestar
(the @file tag MUST be found before any line of code, that includes preprocessor directives).
2007-02-11(svn r8674) [PSP] -Add: added network code for PSP, based on the work of Turulotruelight
-Add: added general header-inclusing for PSP
2007-02-11(svn r8673) -Codechange: use SetNonBlocking instead of implementing yet ↵rubidium
another version.
2007-01-26(svn r8411) [MorphOS] -Fix: tons of unneeded warnings in networking code, ↵truelight
because MorphOS wants UBYTE arrays and we use char arrays. Solution is a bit hackish.
2007-01-05(svn r7882) -Fix: OS2 is defined as UNIX too, but not for networkingtruelight
2007-01-04(svn r7836) -Codechange: some constness for network/core.rubidium
2007-01-02(svn r7767) -Fix r7751: [OSX] nameclash in includes. ALIGN was defined in ↵bjarni
both a library and macros.h we undefines the library one since we don't need that one anyway
2007-01-02(svn r7759) -Merge: makefile rewrite. This merge features:rubidium
- A proper ./configure, so everything needs to be configured only once, not for every make. - Usage of makedepend when available. This greatly reduces the time needed for generating the dependencies. - A generator for all project files. There is a single file with sources, which is used to generate Makefiles and the project files for MSVC. - Proper support for OSX universal binaries. - Object files for non-MSVC compiles are also placed in separate directories, making is faster to switch between debug and release compiles and it does not touch the directory with the source files. - Functionality to make a bundle of all needed files for for example a nightly or distribution of a binary with all needed GRFs and language files. Note: as this merge moves almost all files, it is recommended to make a backup of your working copy before updating your working copy.