aboutsummaryrefslogtreecommitdiffstats
path: root/common/network
Commit message (Collapse)AuthorAgeFilesLines
* 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
* Move getSockets() to SocketServer interfacePierre Ossman2016-10-051-0/+6
| | | | | Any caller using add or remove should also be able to list the sockets.
* Move socket write event handling in to the RFB corePierre Ossman2016-04-291-2/+7
| | | | | | What to do when a socket is writeable should be handled in the RFB core code as there may be other events we want to fire off when this happens.
* Fix race problem with detecting listening inetd socketsTristan Schmelcher2015-12-292-13/+8
| | | | | | The previous detection would fail if the socket closed before we had time to inspect it, which got us stuck in a loop as we would try (and fail) to do accept() on a non-listening socket.
* Init socket subsystem before parsing filtersPierre Ossman2015-12-071-0/+2
| | | | | | Parsing a filter might be the first thing we do so we need to make sure the socket subsystem is running so that we can look up names.
* Return TcpListener pointers rather than objectsPierre Ossman2015-09-292-82/+50
| | | | | | It is easier to control object life time and avoid magical socket duplication by having a single TcpListener object to pass around. We have to be more careful about deleting the object though.
* Return correct error code from bind()Pierre Ossman2015-09-291-1/+2
| | | | | Closing the socket might overwrite errno so we need to save its value.
* Don't leak socket on setsockopt() errorsPierre Ossman2015-09-291-2/+5
|
* Log which addresses connection attempts are made againstPierre Ossman2015-07-301-0/+6
|
* Properly report connect error codesPierre Ossman2015-07-301-11/+13
| | | | | The logic was flawed and would treat all connect errors as if there were no addresses found.
* Clarify Windows SO_REUSEADDR exceptionPierre Ossman2015-04-231-1/+6
|
* Repair SO_REUSEADDRPierre Ossman2015-04-231-5/+5
| | | | | SO_REUSEADDR needs to be set before we call bind() for it to have any effect. It got shuffled around in e4d9726.
* Require getaddrinfo() on all systemsPierre Ossman2015-03-172-128/+1
| | | | | Every reasonably current system support getaddrinfo() so get rid of the legacy fallbacks.
* Do not look at errno for getaddrinfo() errorsPierre Ossman2015-03-171-2/+4
|
* Replacement for dup() on WindowsPierre Ossman2015-03-171-2/+19
| | | | It doesn't work on sockets, which require a bit more care.
* Fix proper socket headers for Win32Pierre Ossman2015-03-171-0/+6
|
* Resurrect TcpListener::getMyAddresses()Pierre Ossman2015-03-172-0/+59
| | | | | | | | | | | It is needed by WinVNC, but got removed in 892d10a70. Also fix a couple of issues: - Use getnameinfo() in order to be compatible with Windows XP - Make it static since it doesn't use a specific socket - Respect UseIPv4 and UseIPv6 - Flags for getaddrinfo() that match binding code - Dummy service value for Windows compatibility
* Make sure Win32 sockets are available in new listening APIPierre Ossman2015-03-171-0/+5
|
* AI_NUMERICSERV is not available on some systemsPierre Ossman2015-03-171-0/+5
|
* Make sure socket errno defines are available for Win32Pierre Ossman2015-03-171-0/+4
|
* family variable can be unset when matching any addressPierre Ossman2015-03-171-0/+2
|
* IPv6 support for TcpFilter.Tim Waugh2015-03-132-57/+201
|
* Fixed IPv6 support.Tim Waugh2015-03-132-139/+197
| | | | | | | | | | | | The TcpListener constructor now takes a 'struct sockaddr*' instead of a string, and the createTcpListeners function creates TcpListener instances for an address based on the results from getaddrinfo(). The XserverDesktop class now takes a list of TcpListener instances for each of the RFB and HTTP sockets. The TcpListener::closeFd member variable is not used and has been removed.
* Whitespace changes only.Tim Waugh2015-03-111-4/+4
|
* Remove unused variablesPierre Ossman2015-03-031-1/+0
|
* Handle no useful address types from getaddrinfo()Pierre Ossman2015-03-031-0/+3
|
* The compiler cannot figure out if this is assigned properlyPierre Ossman2015-03-031-0/+4
| | | | | The logic is a bit complex so we're going to have to silence the warning with this explicit assignment.
* Add parameters to force IPv4/IPv6 selectionPierre Ossman2015-01-291-1/+27
|
* IPv6: create new socket if IPv6 bind fails (#77).Tim Waugh2014-12-101-93/+90
|
* Fix setsockopt() call on WindowsPierre Ossman2014-11-191-1/+1
| | | | They use char* rather than void*, requiring a cast here.
* Protect IPv6 address strings with []Pierre Ossman2014-11-191-3/+7
| | | | | This is the format we support when converting a string to an address, so it makes sense to use them the other way around.
* Don't assume that it's IPv4 just because it's not IPv6Pierre Ossman2014-11-191-31/+32
| | | | | There might be more protocols in the future, and we might also misdetect things depending on varying IPv6 functions being missing.
* inet_ntoa() want's the address directly, not a pointer to itPierre Ossman2014-11-191-1/+1
|
* TcpSocket: IPv6 handling throughout (#68).Tim Waugh2014-11-171-19/+100
|