summaryrefslogtreecommitdiffstats
path: root/core/io/packet_peer_udp.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Rename `IP_Unix`, `IP_Address` and `TCP_Server` to remove underscoresHugo Locurcio2021-05-061-10/+10
|
* This renames PacketPeerUDP.listen to bind.Fabio Alessandrelli2021-04-121-4/+4
|
* Allow local port control on net_socket connectionsdam2021-04-121-0/+9
|
* Fixes small typos and grammar correctionAnshul7sp12021-03-121-1/+1
|
* 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 🎆
* Disable SO_REUSEADDR for UDP.Fabio Alessandrelli2020-11-271-1/+0
| | | | | It allows binding multiple sockets to the same ADDR:PORT (unlike TCP, which still requires different ADDR:PORT combinations).
* UDPServer handles PacketPeerUDP-client associationFabio Alessandrelli2020-07-141-25/+40
| | | | | | | | | | | UDPServer now uses a single socket which is shared with the PacketPeerUDP it creates and has a new `poll` function to read incoming packets on that socket and delivers them to the appropriate peer. PacketPeerUDP created this way never reads from the socket, but are allowed to write on it using sendto. This is needed because Windows (unlike Linux/BSD) does not support packet routing when multiple sockets are bound on the same address/port.
* Style: Enforce braces around if blocks and loopsRémi Verschelde2020-05-141-11/+21
| | | | | Using clang-tidy's `readability-braces-around-statements`. https://clang.llvm.org/extra/clang-tidy/checks/readability-braces-around-statements.html
* Style: Enforce separation line between function definitionsRémi Verschelde2020-05-141-0/+1
| | | | | | | | | | | | | | | | | | | | | | | I couldn't find a tool that enforces it, so I went the manual route: ``` find -name "thirdparty" -prune \ -o -name "*.cpp" -o -name "*.h" -o -name "*.m" -o -name "*.mm" \ -o -name "*.glsl" > files perl -0777 -pi -e 's/\n}\n([^#])/\n}\n\n\1/g' $(cat files) misc/scripts/fix_style.sh -c ``` This adds a newline after all `}` on the first column, unless they are followed by `#` (typically `#endif`). This leads to having lots of places with two lines between function/class definitions, but clang-format then fixes it as we enforce max one line of separation. This doesn't fix potential occurrences of function definitions which are indented (e.g. for a helper class defined in a .cpp), but it's better than nothing. Also can't be made to run easily on CI/hooks so we'll have to be careful with new code. Part of #33027.
* Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocksRémi Verschelde2020-05-141-19/+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-6/+0
| | | | | | | | | | 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.
* UDPServer and PacketPeerUDP connect_to_host.Fabio Alessandrelli2020-02-161-2/+73
| | | | | | | | | | UDP sockets can be "connected" to filter packets from a specific source. In case of a bound socket (e.g. server), a new socket can be created on the same address/port that will receive all packets that are not filtered by a more specific socket (e.g. the previously connect socket). This way, a UDPServer can listen to new packets, and return a new PacketPeerUDP when receiving one, knowing that is a "new client".
* Remove duplicate WARN_PRINT macro.Marcel Admiraal2020-02-051-1/+1
|
* 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.
* UDP sockets broadcast is now disabled by default.Fabio Alessandrelli2019-12-141-0/+11
| | | | | Add method `set_broadcast_enabled` to allow enabling broadcast via GDScript.
* Multicast support in NetSocket/PacketPeerUDPFabio Alessandrelli2019-06-211-0/+23
|
* Update copyright statements to 2019Rémi Verschelde2019-01-011-2/+2
| | | | Happy new year to the wonderful Godot community!
* Moved member variables to initializer listWilson E. Alvarez2018-12-111-7/+6
|
* Unify PacketPeerUDP using NetSocketFabio Alessandrelli2018-09-121-16/+180
|
* Make core/ includes absolute, remove subfolders from include pathRémi Verschelde2018-09-121-1/+2
| | | | | | This allows more consistency in the manner we include core headers, where previously there would be a mix of absolute, relative and include path-dependent includes.
* Add missing copyright headers and fix formattingRémi Verschelde2018-01-051-0/+1
| | | | | | Using `misc/scripts/fix_headers.py` on all Godot files. Some missing header guards were added, and the header inclusion order was fixed in the Bullet module.
* Update copyright statements to 2018Rémi Verschelde2018-01-011-2/+2
| | | | Happy new year to the wonderful Godot community!
* Use HTTPS URL for Godot's website in the headersRémi Verschelde2017-08-271-1/+1
|
* Removes type information from method bindsIgnacio Etcheverry2017-08-101-2/+2
|
* Add "Godot Engine contributors" copyright lineRémi Verschelde2017-04-081-0/+1
|
* Allow non blocking UDP put_packet in C++.Fabio Alessandrelli2017-03-241-0/+7
| | | | | | - Add blocking mode option to PacketPeerUDP. - put_packet returns ERR_UNAVAILABLE when operation would block. - ENet module uses non-blocking UDP.
* A Whole New World (clang-format edition)Rémi Verschelde2017-03-051-18/+14
| | | | | | | | | | | | | | | | | | | | | | | | I can show you the code Pretty, with proper whitespace Tell me, coder, now when did You last write readable code? I can open your eyes Make you see your bad indent Force you to respect the style The core devs agreed upon A whole new world A new fantastic code format A de facto standard With some sugar Enforced with clang-format A whole new world A dazzling style we all dreamed of And when we read it through It's crystal clear That now we're in a whole new world of code
* Rename the _MD macro to D_METHODHein-Pieter van Braam2017-02-131-8/+8
| | | | | | This new name also makes its purpose a little clearer This is a step towards fixing #56
* Remove set_ip_type from network classes (no longer needed)Fabio Alessandrelli2017-01-231-8/+2
| | | | | | | | | | | | | - TCP: - `listen` bind to wildcard "*" -> dual stack socket - `listen` bind to address -> socket from address type - `connect` -> resolve using best protocol (UNSPEC), socket from address type - UDP: - `listen` bind to wildcard "*" -> dual stack socket - `listen` bind to address -> socket from address type - `put_packet`/`put_var` -> resolve using TYPE_ANY (UNSPEC), socket from address type (to change socket type you must first call `close` it)
* Implement UDP listen bind addressFabio Alessandrelli2017-01-231-1/+1
|
* Convert validity checks of IP_Address to is_valid method.Fabio Alessandrelli2017-01-231-1/+1
|
* UDP.set_send_address to UDP.set_dest_addressJuan Linietsky2017-01-141-3/+3
|
* ObjectTypeDB was renamed to ClassDB. Types are meant to be more generic to ↵Juan Linietsky2017-01-021-9/+9
| | | | | | | | Variant. All usages of "type" to refer to classes were renamed to "class" ClassDB has been exposed to GDScript. OBJ_TYPE() macro is now GDCLASS()
* Merge pull request #7271 from Faless/ipv6_cleanupRémi Verschelde2017-01-021-6/+11
|\ | | | | Fixes and improvementes for IPv6 implementation.
| * Allow setting ip_type for TCP/UDP and HTTP classesFabio Alessandrelli2016-12-091-0/+6
| |
| * Migrate int.IP_TYPE_ constants to IP.TYPE_Fabio Alessandrelli2016-12-091-3/+1
| |
| * Use an instance variable for ip_type in raw socketsFabio Alessandrelli2016-12-091-4/+5
| | | | | | | | | | | | | | PacketPeerUDP/StreamPeerTCP/TCP_Server now uses an instance variable to store the selected ip_type (IPv4/IPv6/ANY, where ANY = dual stack). All calls to resolve addresses, sending/receving data, connecting/listening will use that socket type.
* | Welcome in 2017, dear changelog reader!Rémi Verschelde2017-01-011-1/+1
|/ | | | | | | | That year should bring the long-awaited OpenGL ES 3.0 compatible renderer with state-of-the-art rendering techniques tuned to work as low as middle end handheld devices - without compromising with the possibilities given for higher end desktop games of course. Great times ahead for the Godot community and the gamers that will play our games!
* Set proper ip_type default for listen() and resolve_hostname()Fabio Alessandrelli2016-10-301-1/+1
|
* Add optional IP type param in TCP/UDP connect/set_send_addressFabio Alessandrelli2016-10-301-3/+3
|
* adding ipv6Ariel Manzur2016-10-181-7/+2
|
* Add missing license headers in our source files (#5255)Rémi Verschelde2016-06-181-0/+28
| | | Also removes a couple wrong Godot headers from third-party source files.
* UDP FixesJuan Linietsky2014-11-131-3/+17
| | | | | | | | | | | | | | -=-=-=-=- Curse the day I decided to port UDP code, as it ended up being two nights of work. At least It's done now (I hope). -Fixed UDP Support, API seems stable -Added UDP Chat demo (chat that can lose your packets, heh) -Added helpers to areas and bodies to get list of collided bodies and contained bodies. -Sped up screen/viewport capture code. -Added code to save an image as PNG -Small fix so scripts register their singletons after modules did.
* oopsJuan Linietsky2014-11-121-1/+1
|
* missing bindJuan Linietsky2014-11-121-0/+1
|
* 3D Import Import & UDPJuan Linietsky2014-11-121-0/+48
-=-=-=-=-=-=-=-=-=-=- -Animation Import filter support -Animation Clip import support -Animation Optimizer Fixes, Improvements and Visibile Options -Extremely Experimental UDP support.