Tcl Source Code

Check-in [c77d70c21f]
Login
Bounty program for improvements to Tcl and certain Tcl packages.
Tcl 2019 Conference, Houston/TX, US, Nov 4-8
Send your abstracts to [email protected]
or submit via the online form by Sep 9.

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Fix indenting
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | tip-456
Files: files | file ages | folders
SHA1: c77d70c21ff3e0412e1587d1dc7f2bd6bb8fd0e6
User & Date: jan.nijtmans 2016-11-22 11:24:48
Context
2016-11-24
12:47
Implement the whole TIP 456 specification.

Also introduces the `-reuseaddr' and `-reuseport' option... check-in: e4212ca03b user: limeboy tags: tip-456

2016-11-22
11:24
Fix indenting check-in: c77d70c21f user: jan.nijtmans tags: tip-456
11:21
Added stub entry for tip #456. Documentation and tests still missing. Doesn't conform to TIP yet. check-in: fce8b81c46 user: jan.nijtmans tags: tip-456
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to unix/tclUnixSock.c.

1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
	 * specified port.
	 */

	(void) setsockopt(sock, SOL_SOCKET, SO_REUSEADDR,
		(char *) &reuseaddr, sizeof(reuseaddr));

#ifdef SO_REUSEPORT
    /*
     * Set up to allows multiple sockets on the same host to bind to the same port.
     * The flag can be switched on by setting the lowest bit above the valid maximum port (0xffff).
     */
    if (flags & USE_SOCK_REUSEPORT) {
	int reuseport = 1;
        (void) setsockopt(sock, SOL_SOCKET, SO_REUSEPORT,
            (char *) &reuseport, sizeof(reuseport));
    }
#endif

        /*
         * Make sure we use the same port number when opening two server
         * sockets for IPv4 and IPv6 on a random port.
         *
         * As sockaddr_in6 uses the same offset and size for the port member






|
|
|
|
|

|
|
|







1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
	 * specified port.
	 */

	(void) setsockopt(sock, SOL_SOCKET, SO_REUSEADDR,
		(char *) &reuseaddr, sizeof(reuseaddr));

#ifdef SO_REUSEPORT
	/*
	 * Set up to allows multiple sockets on the same host to bind to the same port.
	 * The flag can be switched on by setting the lowest bit above the valid maximum port (0xffff).
	 */
	if (flags & USE_SOCK_REUSEPORT) {
	int reuseport = 1;
	(void) setsockopt(sock, SOL_SOCKET, SO_REUSEPORT,
		(char *) &reuseport, sizeof(reuseport));
	}
#endif

        /*
         * Make sure we use the same port number when opening two server
         * sockets for IPv4 and IPv6 on a random port.
         *
         * As sockaddr_in6 uses the same offset and size for the port member