summaryrefslogtreecommitdiffstats
path: root/drivers/unix/net_socket_posix.cpp
Commit message (Collapse)AuthorAgeFilesLines
* [Net] Explicitly handle buffer errors in send/recvFabio Alessandrelli2023-07-191-0/+20
|
* One Copyright Update to rule them allRémi Verschelde2023-01-051-29/+29
| | | | | | | | | | | | | | | | | | | | As many open source projects have started doing it, we're removing the current year from the copyright notice, so that we don't need to bump it every year. It seems like only the first year of publication is technically relevant for copyright notices, and even that seems to be something that many companies stopped listing altogether (in a version controlled codebase, the commits are a much better source of date of publication than a hardcoded copyright statement). We also now list Godot Engine contributors first as we're collectively the current maintainers of the project, and we clarify that the "exclusive" copyright of the co-founders covers the timespan before opensourcing (their further contributions are included as part of Godot Engine contributors). Also fixed "cf." Frenchism - it's meant as "refer to / see".
* SCons: Cleanup GCC warnings configurationRémi Verschelde2022-10-101-2/+2
| | | | | | | | | | | | | | - Outright disable spammy warnings due to past or present GCC bugs: * `-Wno-strict-overflow` for GCC 7. * `-Wno-type-limits` for GCC before 11 (regressed in 9/10, might work in earlier releases but at this stage we don't care). * `-Wno-return-type` for GCC 12/13 (regression, still not fixed). - Enable extra warnings conditionally when broken on earlier GCC: * `-Wnoexcept` was removed due to an upstream regression in GCC 9, could be re-enabled (but commented out for now as we actually have `-Wnoexcept` warnings to fix. * `-Wlogical-op` was broken on our variadic templates before GCC 11, now seems fine.
* Unix: Remove now unnecessary I/O defines, cleanupRémi Verschelde2022-10-031-17/+11
| | | | | | | | | | | | | | | | - `LIBC_FILEIO_ENABLED` wasn't defined anywhere, even in _other platforms_. - `NO_NETWORK` is also never defined. It probably isn't enough anyway to disable network APIs in the current codebase. - `UNIX_SOCKET_UNAVAILABLE` is never defined in this code but used by some other platforms, clarify that. - `NO_STATVFS` can be removed as Android supports it since API level 19, which is our current min SDK level. It's also only used for `DirAccessUnix::get_space_left()` which is anyway overridden by `DirAccessJAndroid::get_space_left()` so it shouldn't make a difference. * Fixed documentation for `DirAccess.get_space_left()`. - `NO_FCNTL` is likely also a remnant of early Android days, in current NDK r23 it seems to be available. Also cleaned up unused `fcntl.h` includes. - `NO_ALLOCA` is never defined, and we use alloca in many places now.
* [Web] Rename JavaScript platform to Web.Fabio Alessandrelli2022-08-291-1/+1
| | | | Also rename export name from "HTML5" to "Web".
* Replace most uses of Map by HashMapreduz2022-05-161-1/+1
| | | | | | | | | | | | * Map is unnecessary and inefficient in almost every case. * Replaced by the new HashMap. * Renamed Map to RBMap and Set to RBSet for cases that still make sense (order matters) but use is discouraged. There were very few cases where replacing by HashMap was undesired because keeping the key order was intended. I tried to keep those (as RBMap) as much as possible, but might have missed some. Review appreciated!
* Style: Cleanup single-line blocks, semicolons, dead codeRémi Verschelde2022-02-161-6/+10
| | | | | Remove currently unused implementation of TextureBasisU, could be re-added later on if needed and ported.
* Update copyright statements to 2022Rémi Verschelde2022-01-031-2/+2
| | | | Happy new year to the wonderful Godot community!
* Use range iterators for `Map`Lightning_A2021-09-301-2/+2
|
* Use const references where possible for List range iteratorsRémi Verschelde2021-07-251-1/+1
|
* Use C++ iterators for Lists in many situationsAaron Franke2021-07-231-3/+3
|
* Style: Cleanup uses of double spaces between wordsRémi Verschelde2021-06-071-1/+1
| | | | | Or after punctuation. Tried to leave third-party stuff alone, unless it has been heavily modified for Godot.
* Rename `IP_Unix`, `IP_Address` and `TCP_Server` to remove underscoresHugo Locurcio2021-05-061-14/+14
|
* Core: Drop custom `copymem`/`zeromem` definesRémi Verschelde2021-04-271-5/+5
| | | | | | | | We've been using standard C library functions `memcpy`/`memset` for these since 2016 with 67f65f66391327b2967a20a89c3627e1dd6e84eb. There was still the possibility for third-party platform ports to override the definitions with a custom header, but this doesn't seem useful anymore.
* Merge pull request #47398 from Faless/feature/network-local-port-salvagedRémi Verschelde2021-04-271-15/+48
|\
| * Allow local port control on net_socket connectionsdam2021-04-121-15/+48
| |
* | [Net] Fix socket poll timeout on Windows.Fabio Alessandrelli2021-04-261-1/+1
|/ | | | Now correctly computes the timeout value in milliseconds.
* Update copyright statements to 2021Rémi Verschelde2021-01-011-2/+2
| | | | | | | | | | | | | | Happy new year to the wonderful Godot community! 2020 has been a tough year for most of us personally, but a good year for Godot development nonetheless with a huge amount of work done towards Godot 4.0 and great improvements backported to the long-lived 3.2 branch. We've had close to 400 contributors to engine code this year, authoring near 7,000 commit! (And that's only for the `master` branch and for the engine code, there's a lot more when counting docs, demos and other first-party repos.) Here's to a great year 2021 for all Godot users 🎆
* doc: Warn about using Node internal processingRémi Verschelde2020-11-201-2/+2
| | | | | | | | See #43689. Also 'fixed' some spelling for behavior in publicly visible strings. (Sorry en_GB, en_CA, en_AU, and more... Silicon Valley won the tech spelling war.)
* Remove 32-bit String to_int methodAaron Franke2020-06-031-1/+1
|
* Style: Enforce braces around if blocks and loopsRémi Verschelde2020-05-141-17/+33
| | | | | Using clang-tidy's `readability-braces-around-statements`. https://clang.llvm.org/extra/clang-tidy/checks/readability-braces-around-statements.html
* Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocksRémi Verschelde2020-05-141-13/+0
| | | | | | | | | | | | | | Which means that reduz' beloved style which we all became used to will now be changed automatically to remove the first empty line. This makes us lean closer to 1TBS (the one true brace style) instead of hybridating it with some Allman-inspired spacing. There's still the case of braces around single-statement blocks that needs to be addressed (but clang-format can't help with that, but clang-tidy may if we agree about it). Part of #33027.
* Port member initialization from constructor to declaration (C++11)Rémi Verschelde2020-05-141-3/+1
| | | | | | | | | | Using `clang-tidy`'s `modernize-use-default-member-init` check and manual review of the changes, and some extra manual changes that `clang-tidy` failed to do. Also went manually through all of `core` to find occurrences that `clang-tidy` couldn't handle, especially all initializations done in a constructor without using initializer lists.
* Replace NULL with nullptrlupoDharkael2020-04-021-8/+8
|
* Fix set_reuse_address on non-Windows platforms.Fabio Alessandrelli2020-02-191-2/+0
| | | | Broken after cae0d8853d7a373ad8720289c12c7c2e7b5ef240 .
* Merge pull request #36321 from Faless/net/win_tcp_noreuseRémi Verschelde2020-02-181-3/+10
|\ | | | | Disable NetSocket reuse address on Windows.
| * Disable NetSocket reuse address on Windows.Fabio Alessandrelli2020-02-181-3/+10
| | | | | | | | It actually means reuse port -.- ...
* | Add peek option to NetSocket recv_from.Fabio Alessandrelli2020-02-161-2/+2
|/
* Update copyright statements to 2020Rémi Verschelde2020-01-011-2/+2
| | | | | | | | | | | Happy new year to the wonderful Godot community! We're starting a new decade with a well-established, non-profit, free and open source game engine, and tons of further improvements in the pipeline from hundreds of contributors. Godot will keep getting better, and we're looking forward to all the games that the community will keep developing and releasing with it.
* Make NetSockets quiter.Fabio Alessandrelli2019-12-171-14/+34
| | | | Use print_verbose instead of ERR_* for network errors.
* UDP sockets broadcast is now disabled by default.Fabio Alessandrelli2019-12-141-4/+6
| | | | | Add method `set_broadcast_enabled` to allow enabling broadcast via GDScript.
* NetSocket set_broadcast_enabled returns Error enumFabio Alessandrelli2019-12-101-3/+5
|
* Use WSAConnect instead of connect on Windows.Fabio Alessandrelli2019-10-251-1/+5
| | | | | | | | | | | | | | | The misterious windows networking stack... Using connect instead of WSAConnect causes socket error 10022 under certain conditions. See: https://github.com/godotengine/webrtc-native/ (issue 6) Having to guess, code path for connect is different then WSAConnect with NULL extra parameters. The only reference about weird error with this code mentions something called "Windows Filtering Platform" but windows internals are, as always, obscure. This might be something to try and report to Microsoft if anyone has the time to spare with the likely outcome of being ignored.
* Merge pull request #32616 from Faless/net/fix_close_execRémi Verschelde2019-10-081-0/+18
|\ | | | | Disable socket descriptor sharing with subprocs.
| * Disable socket descriptor sharing with subprocs.Fabio Alessandrelli2019-10-071-0/+18
| | | | | | | | | | | | | | | | | | On Unix systems, sockets are like file descriptors, and file descriptors are usually shared among child processes. This means, that if we spawn a subprocess (or we fork) like we do in the editor, open file descriptors will leak to the new process. This causes issue with sockets as they might remain open and bound (listening) when the original process closes.
* | Optional Unix Socket disable for devices that do not support itJairo2019-09-301-0/+2
|/
* Use reference to constant in functionsqarmin2019-07-101-1/+1
|
* Merge pull request #30126 from qarmin/remove_unnecessary_codeRémi Verschelde2019-07-011-4/+4
|\ | | | | Remove unnecessary code and add some error explanations
| * Remove unnecessary code and add some error explanationsqarmin2019-07-011-4/+4
| |
* | Properly disable SIGPIPE on OSX network sockets.Fabio Alessandrelli2019-06-281-8/+9
|/ | | | | Disable SO_NOSIGPIPE socket option when avaiable. Use MSG_NOSIGNAL send flag on systems that support it.
* Merge pull request #29941 from qarmin/redundant_code_and_othersRémi Verschelde2019-06-271-4/+1
|\ | | | | Remove redundant code, possible NULL pointers and others
| * Some code changed with Clang-Tidyqarmin2019-06-261-4/+1
| |
* | Merge pull request #29935 from Faless/net/get_if_multicast_prRémi Verschelde2019-06-211-0/+68
|\ \ | |/ |/| Multicast, more network interfaces info
| * Multicast support in NetSocket/PacketPeerUDPFabio Alessandrelli2019-06-211-0/+68
| |
* | Merge pull request #29283 from qarmin/fix_some_always_same_valuesRémi Verschelde2019-06-201-1/+1
|\ \ | |/ |/| Remove always true/false values
| * Fix always true/false valuesqarmin2019-06-201-1/+1
| |
* | Fix compilation warnings in JS and Windows buildsRémi Verschelde2019-06-151-3/+3
|/ | | | | | | | | | Warnings raised by Emscripten 1.38.0 and MinGW64 5.0.4 / GCC 8.3.0. JS can now build with `werror=yes warnings=extra`. MinGW64 still has a few warnings to resolve with `warnings=extra`, and only one with `warnings=all`. Part of #29033 and #29801.
* Ignore a warning in _get_socket_error (-Wlogical-op).marxin2019-05-021-0/+11
| | | | | | | | | | | | | | drivers/unix/net_socket_posix.cpp: In member function 'NetSocketPosix::NetError NetSocketPosix::_get_socket_error()': drivers/unix/net_socket_posix.cpp:197:22: warning: logical 'or' of equal expressions [-Wlogical-op] 197 | if (errno == EAGAIN || errno == EWOULDBLOCK) | ^ and: modules/mono/utils/string_utils.cpp: In function 'int {anonymous}::sfind(const String&, int)': modules/mono/utils/string_utils.cpp:68:48: error: logical 'or' of collectively exhaustive tests is always true [-Werror=logical-op] found = src[read_pos] == 's' || (c >= '0' || c <= '4'); ~~~~~~~~~^~~~~~~~~~~
* Fix typos with codespellRémi Verschelde2019-02-131-1/+1
| | | | | | | | | | | | | | | | | | | | Using codespell 1.14.0. Method: ``` $ cat > ../godot-word-whitelist.txt << EOF ang doubleclick lod nd numer que te unselect EOF $ codespell -w -q 3 -I ../godot-word-whitelist.txt --skip="./thirdparty,*.po" $ git diff // undo unwanted changes ```
* Update copyright statements to 2019Rémi Verschelde2019-01-011-2/+2
| | | | Happy new year to the wonderful Godot community!