1
0
Fork 0
Commit Graph

20 Commits

Author SHA1 Message Date
Tiger Wang 951a0212d8 Move IsValidSocket out of global namespace 2020-07-18 14:20:31 +01:00
peterbell10 13144a08e4
Enable some more clang-tidy linter checks (#4738)
* Avoid inefficient AString -> c_str() -> AString round trip

* Avoid redundant string init expressions

* Avoid unnecessary return, continue, etc.

* Add .clang-format to help with clang-tidy fix-its

* Avoid unnecessary passing by value

* Avoid unnecessary local copying

* Avoid copying in range-for loops

* Avoid over-complicated boolean expressions

* Some violations missed by my local clang-tidy

* Allow unnecessary continue statements

* Add brackets

* Another expression missed locally

* Move BindingsProcessor call into clang-tidy.sh and add space

* Fix pushd not found error

* Different grouping of CheckBlockInteractionRate
2020-05-14 22:15:35 +00:00
Mattes D 42cc736bfd
ServerHandle: Fix closing failed servers. (#4653)
If the cServerHandle failed to listen, closing it would then crash Cuberite.
2020-04-15 14:13:40 +02:00
Mat 318d31dc39
Use a reasonable listen backlog value (#4597) 2020-04-02 16:05:07 +02:00
peterbell10 a4dbb5c582
Prefer static_cast to reinterpret_cast (#4223)
* Change reinterpret_cast -> static_cast wherever possible
* Remove more unnecessary `const_cast`s.

reinterpret_casts should be avoided for the same reason as c-style casts - they don't do any type-checking. reinterpret_cast was mainly being used for down-casting in inheritance hierarchies but static_cast works just as well while also making sure that there is actually an inheritance relationship there.
2018-05-02 08:50:36 +01:00
Julian Laubstein dd5201c29e Some warning fixes 2015-08-18 08:49:00 +02:00
Mattes D a55eaba7fa Network: Fixed ServerHandle's address formatting. 2015-07-07 18:10:47 +02:00
Mattes D 612637ab2e Network: Fixed two-socket servers. 2015-02-18 09:35:14 +01:00
Mattes D 81d7329ad3 ServerHandle: Fixed socket reuse.
Fixes CID 104670, CID 104670 and CID 103724.
2015-02-08 14:41:24 +01:00
Howaner be528a9f52 Use evutil_make_listen_socket_reuseable 2015-02-07 18:39:24 +01:00
Howaner d32831d7e8 Set reuse flag to sockets
Should fix #1726
2015-02-07 11:03:38 +01:00
Mattes D 79dee9bb70 Fixed listening ports not closed on cServerHandle::Close. 2015-01-27 14:53:39 +01:00
Mattes D 2557f2867d ServerHandleImpl: Removed needless diagnostic output. 2015-01-27 14:53:36 +01:00
Mattes D 1f2f8b553b cNetwork: Fixed IP address reading for incoming connections. 2015-01-27 14:53:30 +01:00
Mattes D 10cfa61fbc cNetwork: Added self pointers to keep objects alive for callbacks.
Ref.: http://forum.mc-server.org/showthread.php?tid=1700&pid=17947#pid17947
2015-01-23 23:01:18 +01:00
Mattes D dbf7f13bd4 cNetwork: Added link creation callback.
This allows the callback classes to store the link inside them and use it internally later on, mainly for sending data.
2015-01-22 20:13:06 +01:00
Mattes D 5b4c5cf2be cNetwork: Changed listening API.
The link-callbacks for each new accepted link are now received from the OnIncomingConnection listen-callback.
2015-01-22 20:13:05 +01:00
Mattes D 64855ed340 cNetwork: Added error message to error callbacks. 2015-01-22 20:13:04 +01:00
Mattes D 00253403b3 cTCPLinkImpl: Fixed type conversion warning. 2015-01-22 20:13:03 +01:00
Mattes D c0cb787c10 cNetwork: Split the main cpp file into several files. 2015-01-22 20:13:02 +01:00