{"id":19924128,"url":"https://github.com/acassen/socket-takeover","last_synced_at":"2025-05-03T07:31:16.254Z","repository":{"id":45373462,"uuid":"133371069","full_name":"acassen/socket-takeover","owner":"acassen","description":"Socket takeover from one process to another","archived":false,"fork":false,"pushed_at":"2023-11-22T08:03:15.000Z","size":23,"stargazers_count":48,"open_issues_count":0,"forks_count":10,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-24T17:55:21.953Z","etag":null,"topics":["high-availability","socket-programming","socket-takeover","takeover"],"latest_commit_sha":null,"homepage":null,"language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/acassen.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"COPYING","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-05-14T14:11:41.000Z","updated_at":"2025-04-17T17:19:51.000Z","dependencies_parsed_at":"2022-08-12T11:51:59.832Z","dependency_job_id":null,"html_url":"https://github.com/acassen/socket-takeover","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/acassen%2Fsocket-takeover","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/acassen%2Fsocket-takeover/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/acassen%2Fsocket-takeover/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/acassen%2Fsocket-takeover/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/acassen","download_url":"https://codeload.github.com/acassen/socket-takeover/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252156879,"owners_count":21703367,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["high-availability","socket-programming","socket-takeover","takeover"],"created_at":"2024-11-12T22:16:26.740Z","updated_at":"2025-05-03T07:31:15.669Z","avatar_url":"https://github.com/acassen.png","language":"C","funding_links":[],"categories":["Protocols"],"sub_categories":["Dataplane acceleration"],"readme":"Socket Takeover: Socket takeover from one process to another\n============================================================\n\nWhen you are running business mission critical services you MUST rely on\ndesign offering zero downtime. It is truly the case when considering\nupgrading/updating such mission critical software components.\n\nThis software introduce a design pattern to perform seamless TCP socket\ntakeover from one process to another. The code here is just a proof of\nconcept and can be used for experimentation or integration into more\ncomplex software component.\n\nThis source code is using design present in 4.4BSD systems. Using SCM_RIGHTS\nancillary data over a Unix domain socket to transport a set of file descriptors.\nYou can find more informations on this technic by reading good litterature from\n[W. Richard Stevens: UNIX Network Programming Volume 1 Third Edition], section 15.7.\nThe code proposed here will make it more Linux specific by introducting a mechanism\nto takeover and synchronize client/server interactions.\n\n\n# Content\n\n2 directories are available :\n\n\t* server : TCP server code\n\t* client : TCP client code\n\n\n# Give it a try : Server side\n\n\t$ cd server\n\t$ make\n\t$ ./server -h\n\tUsage: ./server [OPTION...]\n\t  -a, --listen-address\t\tAddress to bind TCP listener on\n\t  -p, --listen-port\t\tPort to bind TCP listener on\n\t  -b, --listen-backlog\t\tTCP listener backlog\n\t  -t, --takeover-path\t\tTakeover channel unix domain path\n\t  -T, --takeover\t\tPerform takeover operation\n\t  -h, --help\t\t\tDisplay this help message\n\t$ ./server -a 127.0.0.1 -p 1234 -t /tmp/.takeover\n\n\n# Give it a try : Client side\n\n\t$ cd client\n\t$ make\n\t$ ./client -h\n\tUsage: ./client [OPTION...]\n\t  -a, --connect-address\t\tConnection Address\n\t  -p, --connect-port\t\tConnection Port\n\t  -h, --help\t\t\tDisplay this help message\n\t$ ./client -a 127.0.0.1 -p 1234\n\n\n# Having fun\n\n\t[client]$ ./client -a 127.0.0.1 -p 1234\n\n\n\t[server/sh1]$ ./server -a 127.0.0.1 -p 1234 -t /tmp/.takeover\n\tStarting TCP server on [127.0.0.1]:1234 (fd:3)\n\tStarting Takeover channel on [/tmp/.takeover] domain socket\n\tAccepting connection from Peer [127.0.0.1]:57796 (fd:4)\n\tStarting connection with Peer [127.0.0.1]:57796 (fd:4)\n\t[127.0.0.1]:57796 - seqnum:0\n\t[127.0.0.1]:57796 - seqnum:1\n\t[127.0.0.1]:57796 - seqnum:2\n\t[127.0.0.1]:57796 - seqnum:3\n\t[127.0.0.1]:57796 - seqnum:4\n\t[127.0.0.1]:57796 - seqnum:5\n\t[127.0.0.1]:57796 - seqnum:6\n\t[127.0.0.1]:57796 - seqnum:7\n\t[127.0.0.1]:57796 - seqnum:8\n\t[127.0.0.1]:57796 - seqnum:9\n\t[127.0.0.1]:57796 - seqnum:10\n\t[127.0.0.1]:57796 - seqnum:11\n\t[127.0.0.1]:57796 - seqnum:12\n\t[127.0.0.1]:57796 - seqnum:13\n\t[127.0.0.1]:57796 - seqnum:14\n\t[127.0.0.1]:57796 - seqnum:15\n\t[127.0.0.1]:57796 - seqnum:16\n\t[127.0.0.1]:57796 - seqnum:17\n\t[127.0.0.1]:57796 - seqnum:18\n\t[127.0.0.1]:57796 - seqnum:19\n\tAccepting connection from Takeover channel\n\tCurrent fd_array:={[3][4]}\n\t[127.0.0.1]:57796 - seqnum:20\n\tHolding connection with Peer [127.0.0.1]:57796 (fd:4)\n\tReleasing Peer [127.0.0.1]:57796 (fd:4)\n\ttcp_peer_release(): Tcp peers released...\n\n\n\t[server/sh2]$ ./server -T /tmp/.takeover \n\tStarting connection with Peer [127.0.0.1]:57796 (fd:5)\n\tStarting Takeover channel on [/tmp/.takeover] domain socket\n\t[127.0.0.1]:57796 - seqnum:21\n\t[127.0.0.1]:57796 - seqnum:22\n\t[127.0.0.1]:57796 - seqnum:23\n\t[127.0.0.1]:57796 - seqnum:24\n\t[127.0.0.1]:57796 - seqnum:25\n\t[127.0.0.1]:57796 - seqnum:26\n\t[127.0.0.1]:57796 - seqnum:27\n\t[127.0.0.1]:57796 - seqnum:28\n\t[127.0.0.1]:57796 - seqnum:29\n\t...\n\n\nEnjoy,\nAlexandre\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Facassen%2Fsocket-takeover","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Facassen%2Fsocket-takeover","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Facassen%2Fsocket-takeover/lists"}