aboutsummaryrefslogtreecommitdiffstats
path: root/common/network
Commit message (Collapse)AuthorAgeFilesLines
* MSVC: fix compile error in Socket.cxxKang Lin14 days1-2/+1
|
* Stop relying on "using namespace"Pierre Ossman2025-02-251-1/+0
| | | | | | There were not many uses of this left after the move to std::exception and the move to the core library. Let's get rid of the last stragglers and reduce the risk of name collisions.
* Move winerrno.h to corePierre Ossman2025-02-252-2/+2
| | | | | OS abstractions are generic enough that we can merge these with the new core library.
* Rename core/util to core/stringPierre Ossman2025-02-251-1/+1
| | | | | It's just string helper functions here, so let's get rid of the catch-all name for this module.
* Move logging to core libraryPierre Ossman2025-02-254-10/+7
| | | | | | | Make it clearer what is protocol handling and what is just general plumbing. This is one step of several.
* Move configuration to core libraryPierre Ossman2025-02-251-3/+3
| | | | | | | Make it clearer what is protocol handling and what is just general plumbing. This is one step of several.
* Move base exception classes to core libraryPierre Ossman2025-02-253-28/+26
| | | | | | | Make it clearer what is protocol handling and what is just general plumbing. This is one step of several.
* Move utility functions to core libraryPierre Ossman2025-02-132-7/+8
| | | | | | | Make it clearer what is protocol handling and what is just general plumbing. This is one step of several.
* Move getHostAndPort() to network libraryPierre Ossman2025-02-132-0/+90
| | | | | This is a network function, so it makes more sense in the network library.
* Reduce header #include:sPierre Ossman2025-02-134-4/+22
| | | | | Make compile times faster by reducing the number of headers included in other headers.
* Always flush sockets on shutdown()Pierre Ossman2024-12-171-0/+15
| | | | | | | | The system shutdown() function doesn't drop buffered data, so neither should we. We had one fix in place, but that didn't cover all cases. Move this handling to all socket like classes we have.
* Capitalize some more logging and exceptionsPierre Ossman2024-11-223-15/+15
|
* Merge branch 'master' of https://github.com/madnicendio/tigervncPierre Ossman2024-11-222-18/+18
|\
| * Capitalize first letter in log, exception & errorMadeleine Nilsson2024-11-212-18/+18
| | | | | | | | The reason for this is to keep a consistency through out the project.
* | Use standard library naming for exceptionsPierre Ossman2024-11-063-23/+23
| | | | | | | | | | This makes things more consistent since we mix with the standard library exceptions so often.
* | Use standard exception classesPierre Ossman2024-11-063-7/+16
| | | | | | | | | | Use the more specific already included exception classes for common errors to keep things more understandable.
* | Use static string for exceptionsPierre Ossman2024-11-061-2/+2
|/ | | | | In preparation for using the built in C++ exception classes, which do not accept a format string.
* Move SocketException to rdrPierre Ossman2024-10-092-8/+3
| | | | | | Socket APIs are used in more places than the abstraction in common/network. Make it easier to use this exception class by putting it in a more common place.
* Avoid shadowing variablesPierre Ossman2024-06-243-6/+6
| | | | | It's a source of confusion and possibly bugs to reuse the same variable name for multiple things.
* Mark overridden virtual functionsPierre Ossman2024-06-242-9/+9
| | | | | Use the new "override" keyword to properly differentiate between new virtual methods, and existing virtual methods being overridden.
* Use nullptr in all C++ codePierre Ossman2024-06-242-28/+28
| | | | | It's more readable than 0, and a bit safer than NULL, so let's try to follow modern norms.
* Remove the network::SocketServer interface.Carlos Santos2024-04-261-35/+0
| | | | | | | Move these RFB specific things to rfb::VNCServer, for clarity. Signed-off-by: Pierre Ossman <ossman@cendio.se> Signed-off-by: Carlos Santos <casantos@redhat.com>
* More graceful handling of disabled listenersPierre Ossman2023-09-081-4/+0
| | | | | | Don't assume a lack of TCP listeners means the server will be unreachable. There might be other methods of access, so let the higher levels do that sanity check instead.
* Prefer target_include_directories()Pierre Ossman2023-03-311-2/+1
| | | | | It is more specific, and it properly sets up propagation when include directories also need to be used further down a dependency chain.
* Add all common inter-dependenciesPierre Ossman2023-03-311-0/+2
| | | | | This is important in case there are build flags that need to propagate between libraries for things to build correctly.
* Remove "str" prefix from string helpersPierre Ossman2023-02-041-2/+2
| | | | | This matches the naming in STL, which is what we are mostly mimicing now that we are using std::string for these functions.
* Use std::string instead of CharArrayPierre Ossman2023-02-041-0/+1
| | | | | Let's use a more common type instead of something homegrown. Should be more familiar to new developers.
* Make strSplit() simpler and saferPierre Ossman2023-02-041-22/+21
| | | | | | | Get rid of all the magical re-allocation and shuffling and instead just return a new set of strings that is fully splitted. Will consume a bit more memory, but is a lot safer to use as there is less confusion about ownership of memory.
* Return std::string instead of dynamic allocationsPierre Ossman2023-02-042-9/+17
| | | | | | We mostly use classical C strings, but the memory management around them can get confusing and error prone. Let's use std::string for the cases where we need to return a newly allocated string.
* Better fallback for missing peer addressPierre Ossman2023-02-041-3/+3
| | | | | | A blank string might be very confusing, depending on where this will be used. Let's give something more visible back in the cases where we cannot get the proper name for the peer.
* Return static char buffer from some methodsPierre Ossman2023-02-045-33/+30
| | | | | | | | | This mimics how some system functions (like inet_ntop()) work, and avoids complexity around ownership of the returned string buffer. The downside is that the string must be consumed directly as it will be overwritten on the next call, but that is not an issue with the current usage.
* Remove unneeded CharArray:sPierre Ossman2023-02-041-12/+9
| | | | | Avoid complicating things by moving things in to a second buffer here as there is no need for it.
* Avoid temporary cmake variablesPierre Ossman2022-06-071-4/+2
| | | | | Modern cmake has better support for adding source files and libraries incrementally, so let's use that to clean things up.
* Merge branch 'noblock' of https://github.com/CendioOssman/tigervncPierre Ossman2021-01-196-23/+6
|\
| * Generalise corking to all output streamsPierre Ossman2020-05-215-21/+1
| | | | | | | | | | The principle can be used in a more general fashion than just TCP streams.
| * Use proper constants for socket shutdown()Pierre Ossman2020-05-211-2/+5
| | | | | | | | For readability.
* | Free memory from getaddrinfo()Pierre Ossman2020-08-171-0/+2
| | | | | | | | | | We handled this in the failure scenario, but not in the vastly more common successful case.
* | Correction to socket error connection messageAndrew Yoder2020-07-151-1/+1
|/
* Throw GAIException() for getaddrinfo errorsAlex Tanskanen2020-03-171-6/+3
| | | | | | | | Created a new subclass of Exception called GAIException() that will handle error messages from getaddrinfo() instead of letting Exception() handle it. GAIException() will make use of gai_strerror() to map the error code to text. On Windows, gai_strerrorW() must be used if the text is encoded with UTF-8.
* Fix typo in SocketException messageAlex Tanskanen2020-03-121-1/+1
|
* Merge branch 'covscan' of https://github.com/grulja/tigervncPierre Ossman2018-11-211-1/+1
|\
| * Use empty address buffer when sockaddr sa_family is not what we wantJan Grulich2018-09-261-1/+1
| |
* | Get rid of SocketServer::checkTimeouts()Pierre Ossman2018-11-091-7/+0
| | | | | | | | | | | | It doesn't belong on each socket server object as timers are global. Force implementations to call the Timer system directly instead, avoiding any middle men.
* | Move ListConnInfo to WinVNC directoryPierre Ossman2018-11-091-2/+0
|/ | | | | It is functionality specific to WinVNC, so move the code there to make things more clear.
* Merge common socket codePierre Ossman2018-05-297-216/+255
|
* Remove unused code from socket classesPierre Ossman2018-05-295-109/+24
|
* Add support for Unix socketsPierre Ossman2018-05-293-1/+327
| | | | Patch originally by Dag-Erling Smørgrav for University of Oslo.
* Use abstract SocketListener classPierre Ossman2018-05-043-8/+11
| | | | | Makes the code more general and not directly tied to specifically TCP sockets.
* Define cork() as pure virtual in Socket classPeter Åstrand (astrand)2017-11-083-3/+4
| | | | | | This makes it possible to create a derived class from Socket which is not TCP based, without having VNCSConnectionST.cxx trying to call setsockopt() on a non-socket.
* Add missing virtual destructorsSteve Kondik2017-07-081-0/+1
| | | | | | | | | | | | | | Fix warnings emitted by Clang: /home/shade/dev/tigervnc/common/rdr/FdInStream.h:30:9: error: 'rdr::FdInStreamBlockCallback' has virtual functions but non-virtual destructor [-Werror,-Wnon-virtual-dtor] class FdInStreamBlockCallback { ^ In file included from /home/shade/dev/tigervnc/common/network/TcpSocket.cxx:44: In file included from /home/shade/dev/tigervnc/common/network/TcpSocket.h:31: /home/shade/dev/tigervnc/common/network/Socket.h:82:9: error: 'network::ConnectionFilter' has virtual functions but non-virtual destructor [-Werror,-Wnon-virtual-dtor] class ConnectionFilter { ^ ..etc