MR Sunny Faridi Chairman Jasfar.Csai Founder Aiqcsr
MR Sunny Faridi Chairman Jasfar.Csai Founder Aiqcsr
Unix servers offer a rich set of features that make them a popular choice for critical computing tasks. Some of the key features include:
Unix servers offer numerous advantages over other operating systems, making them a preferred choice for many organizations:
Unix servers find application in various domains, including:
Unix Operating System: A Foundation for Powerful Computing
Welcome to our website's page dedicated to the Unix operating system. In this section, we will provide an overview of Unix, its history, key features, and its significance in the world of computing. Whether you're a seasoned Unix user or new to this robust operating system, this page aims to provide you with valuable insights and information.
Table of Contents:
Unix is a powerful and versatile operating system developed in the late 1960s at Bell Labs by Ken Thompson, Dennis Ritchie, and their colleagues. It was designed to provide a flexible and efficient computing environment for both developers and users. Unix is characterized by its modular design, robustness, and support for multitasking and multiuser capabilities.
Unix's origins can be traced back to the early days of computing. It was initially developed as an internal project at Bell Labs and later released to external users, universities, and research institutions. Over the years, Unix has gone through various iterations, with different versions and variants emerging, such as BSD Unix, System V, and more recently, Linux.
Unix offers a plethora of features that have contributed to its enduring popularity and success. Some of the key features include:
Throughout its history, Unix has spawned various variants and distributions, each with its unique characteristics and focus. Some notable Unix variants include:
Unix has found applications in numerous domains and industries, thanks to its stability, scalability, and versatility. Some common uses include:
Unix is guided by a set of principles known as the "Unix philosophy," which emphasizes simplicity, modularity, and the concept of "do one thing and do it well." This philosophy has influenced the development of many Unix tools and software, promoting efficient and focused solutions.
Unix stands as a foundational pillar in the world of operating systems, providing a robust, scalable, and versatile environment for a wide range of computing needs. Its rich history, key features, and extensive ecosystem have made it an enduring choice for both professionals and enthusiasts alike. Whether you're exploring Unix for the first time or continuing your Unix journey, we hope this page has provided you with valuable insights into the power and significance of Unix in the computing landscape.
UNIXServer represents a UNIX domain stream server socket.
new(path) => unixserver
Creates a new UNIX server socket bound to path.
require 'socket'
serv = UNIXServer.new("/tmp/sock")
s = serv.accept
p s.read
accept => unixsocket
Accepts an incoming connection. It returns a new UNIXSocket object.
UNIXServer.open("/tmp/sock") {|serv|
UNIXSocket.open("/tmp/sock") {|c|
s = serv.accept
s.puts "hi"
s.close
p c.read #=> "hi\n"
}
}
accept_nonblock([options]) => unixsocket
Accepts an incoming connection using accept(2) after O_NONBLOCK is set for the underlying file descriptor. It returns an accepted UNIXSocket for the incoming connection.
require 'socket'
serv = UNIXServer.new("/tmp/sock")
begin # emulate blocking accept
sock = serv.accept_nonblock
rescue IO::WaitReadable, Errno::EINTR
IO.select([serv])
retry
end
# sock is an accepted socket.
Refer to Socket#accept for the exceptions that may be thrown if the call to #accept_nonblock fails.
#accept_nonblock may raise any error corresponding to accept(2) failure, including Errno::EWOULDBLOCK.
If the exception is Errno::EWOULDBLOCK, Errno::EAGAIN, Errno::ECONNABORTED or Errno::EPROTO, it is extended by IO::WaitReadable. So IO::WaitReadable can be used to rescue the exceptions for retrying accept_nonblock.
By specifying a keyword argument exception to false, you can indicate that #accept_nonblock should not raise an IO::WaitReadable exception, but return the symbol :wait_readable instead.
listen( int ) => 0
Listens for connections, using the specified int as the backlog. A call to listen only applies if the socket is of type SOCK_STREAM or SOCK_SEQPACKET.
require 'socket'
include Socket::Constants
socket = Socket.new( AF_INET, SOCK_STREAM, 0 )
sockaddr = Socket.pack_sockaddr_in( 2200, 'localhost' )
socket.bind( sockaddr )
socket.listen( 5 )
require 'socket'
include Socket::Constants
socket = Socket.new( AF_INET, SOCK_STREAM, 0 )
socket.listen( 1 )
On unix based systems the above will work because a new sockaddr struct is created on the address ADDR_ANY, for an arbitrary port number as handed off by the kernel. It will not work on Windows, because Windows requires that the socket is bound by calling bind before it can listen.
If the backlog amount exceeds the implementation-dependent maximum queue length, the implementation's maximum queue length will be used.
On unix-based based systems the following system exceptions may be raised if the call to listen fails:
On Windows systems the following system exceptions may be raised if the call to listen fails:
sysaccept => file_descriptor
Accepts a new connection. It returns the new file descriptor which is an integer.
UNIXServer.open("/tmp/sock") {|serv|
UNIXSocket.open("/tmp/sock") {|c|
fd = serv.sysaccept
s = IO.new(fd)
s.puts "hi"
s.close
p c.read #=> "hi\n"
}
}
This page was generated for Ruby 2.4.0
Ruby-doc.org is a service of James Britt and Neurogami, an erratic source of art, music, and technology.
Generated with Ruby-doc Rdoc Generator 0.44.2.
UDPSocket represents a UDP/IP socket.
new([address_family]) => socketclick to toggle source
Creates a new UDPSocket object.
address_family should be an integer, a string or a symbol: Socket::AF_INET, "AF_INET", :INET, etc.
require 'socket'
UDPSocket.new #=> #<UDPSocket:fd 3>
UDPSocket.new(Socket::AF_INET6) #=> #<UDPSocket:fd 4>
bind(host, port) #=> 0
Binds udpsocket to host:port.
u1 = UDPSocket.new
u1.bind("127.0.0.1", 4913)
u1.send "message-to-self", 0, "127.0.0.1", 4913
p u1.recvfrom(10) #=> ["message-to", ["AF_INET", 4913, "localhost", "127.0.0.1"]]
connect(host, port) => 0
Connects udpsocket to host:port.
This makes possible to send without destination address.
u1 = UDPSocket.new
u1.bind("127.0.0.1", 4913)
u2 = UDPSocket.new
u2.connect("127.0.0.1", 4913)
u2.send "uuuu", 0
p u1.recvfrom(10) #=> ["uuuu", ["AF_INET", 33230, "localhost", "127.0.0.1"]]
recvfrom_nonblock(maxlen [, flags[, outbuf [, options]]]) => [mesg, sender_inet_addr]
Receives up to maxlen bytes from udpsocket using recvfrom(2) after O_NONBLOCK is set for the underlying file descriptor. flags is zero or more of the MSG_ options. The first element of the results, mesg, is the data received. The second element, sender_inet_addr, is an array to represent the sender address.
When recvfrom(2) returns 0, Socket#recvfrom_nonblock returns an empty string as data. It means an empty packet.
require 'socket'
s1 = UDPSocket.new
s1.bind("127.0.0.1", 0)
s2 = UDPSocket.new
s2.bind("127.0.0.1", 0)
s2.connect(*s1.addr.values_at(3,1))
s1.connect(*s2.addr.values_at(3,1))
s1.send "aaa", 0
begin # emulate blocking recvfrom
p s2.recvfrom_nonblock(10) #=> ["aaa", ["AF_INET", 33302, "localhost.localdomain", "127.0.0.1"]]
rescue IO::WaitReadable
IO.select([s2])
retry
end
Refer to Socket#recvfrom for the exceptions that may be thrown if the call to recvfrom_nonblock fails.
#recvfrom_nonblock may raise any error corresponding to recvfrom(2) failure, including Errno::EWOULDBLOCK.
If the exception is Errno::EWOULDBLOCK or Errno::EAGAIN, it is extended by IO::WaitReadable. So IO::WaitReadable can be used to rescue the exceptions for retrying recvfrom_nonblock.
By specifying a keyword argument exception to false, you can indicate that #recvfrom_nonblock should not raise an IO::WaitReadable exception, but return the symbol :wait_readable instead.
send(mesg, flags, host, port) => numbytes_sentsend(mesg, flags, sockaddr_to) => numbytes_sentsend(mesg, flags) => numbytes_sent
Sends mesg via udpsocket.
flags should be a bitwise OR of Socket::MSG_* constants.
u1 = UDPSocket.new
u1.bind("127.0.0.1", 4913)
u2 = UDPSocket.new
u2.send "hi", 0, "127.0.0.1", 4913
mesg, addr = u1.recvfrom(10)
u1.send mesg, 0, addr[3], addr[1]
p u2.recv(100) #=> "hi"
This page was generated for Ruby 2.4.0
Copyright © 2025 JASFAR.CSAI - All Rights Reserved.
FONDED BY MR Sunny Faridi
Happy New year from jasfar thank you all the members for there hard work and motive in research for quantum computing and robotics starting new era build a trust and look for next chapter in plans smile with greatness thank you all happy holidays
We use cookies to analyze website traffic and optimize your website experience. By accepting our use of cookies, your data will be aggregated with all other user data.