TCP client and multithreaded server in 14 lines of Ruby code
require "socket" server = TCPServer.open(2626) loop do Thread.fork(server.accept) do |client| client.puts("Hello, I'm Ruby TCP server", "I'm disconnecting, bye :*")
WARNING This page contains incomplete and possibly incorrect info. The page is constantly being edited and worked on. Many of these should work but some may be broken. Read the code carefully to understand what you are doing, stuff may be nedd to be changed for your use. Use at your own risk.
*** QBRD note: I have chosen different names for my zvol and so. I HAVE TRIED TO USE THE NAMES DESCRIBBED IN "Setup" SECTION! Please be aware of copy/paste errors where my actual zvol name may be used.
|# frozen_string_literal: true|
|# The MIT License (MIT)|
|# Copyright:: 2017, QubitRenegade|
|# Permission is hereby granted, free of charge, to any person obtaining a copy|
|# of this software and associated documentation files (the "Software"), to deal|
|# in the Software without restriction, including without limitation the rights|
|# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell|