# Reuire 'socket' modules?

**URL:** <https://www.ruby-forum.com/t/reuire-socket-modules/183728>\
**Category:** Ruby\
**Created:** [February 19, 2010, 8:24am UTC](https://www.ruby-forum.com/t/reuire-socket-modules/183728 "2010-02-19T08:24:50Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![youthreewire](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/y/90ced4/32.png) [@youthreewire](https://www.ruby-forum.com/u/youthreewire)\
**Post date:** [February 19, 2010, 8:24am UTC](https://www.ruby-forum.com/t/reuire-socket-modules/183728/1 "2010-02-19T08:24:50Z")

</div>

Hi,

I have a sort of minimal ruby environment.I need to get socket  
programming running in it.So what are the associated files that I need  
to add form the full fledged ruby folders (in windows?)

Please let me know.I did search in the lib folder but it does not have  
anything named socket.

---

<div class="post-metadata">

**Author:** ![youthreewire](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/y/90ced4/32.png) [@youthreewire](https://www.ruby-forum.com/u/youthreewire)\
**Post date:** [February 19, 2010, 6:12pm UTC](https://www.ruby-forum.com/t/reuire-socket-modules/183728/2 "2010-02-19T18:12:08Z")

</div>

On 19.02.2010 08:25, di vi wrote:

> I have a sort of minimal ruby environment.I need to get socket  
> programming running in it.So what are the associated files that I need  
> to add form the full fledged ruby folders (in windows?)

It depends what you want to do. Ruby has a number of high level  
libraries as well as plain sockets.

> Please let me know.I did search in the lib folder but it does not have  
> anything named socket.

You probably better search the documentation.

> **[Ruby-Doc.org: Documenting the Ruby Language](https://ruby-doc.org/)**
>
> Fast, searchable Ruby documentation for core and standard libraries. Plus, links to tutorials, guides, books, and related sites.

Especially [Programming Ruby: The Pragmatic Programmer's Guide](http://www.ruby-doc.org/docs/ProgrammingRuby/)

Kind regards

robert

---

<div class="post-metadata">

**Author:** ![youthreewire](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/y/90ced4/32.png) [@youthreewire](https://www.ruby-forum.com/u/youthreewire)\
**Post date:** [February 19, 2010, 9:31pm UTC](https://www.ruby-forum.com/t/reuire-socket-modules/183728/3 "2010-02-19T21:31:57Z")

</div>

Robert K. wrote:

> On 19.02.2010 08:25, di vi wrote:
> 
> > I have a sort of minimal ruby environment.I need to get socket  
> > programming running in it.So what are the associated files that I need  
> > to add form the full fledged ruby folders (in windows?)
> 
> It depends what you want to do. Ruby has a number of high level  
> libraries as well as plain sockets.

I just want to know the associated socket modules (libraries,etc…)  
which support running the following code:

require “socket”

i = 0  
dts = TCPServer.new(‘localhost’, 1101)  
loop do  
Thread.start(dts.accept) do |s|  
print “connection established”  
while i \< i+1 do  
#print(s, " is accepted\n")  
#s.write(Time.now)  
str = s.recv( 100 )  
print str  
end  
#print(s, " is gone\n")  
s.close  
end  
end

---

<div class="post-metadata">

**Author:** ![youthreewire](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/y/90ced4/32.png) [@youthreewire](https://www.ruby-forum.com/u/youthreewire)\
**Post date:** [February 19, 2010, 9:47pm UTC](https://www.ruby-forum.com/t/reuire-socket-modules/183728/4 "2010-02-19T21:47:26Z")

</div>

> I just want to know the associated socket modules (libraries,etc…)  
> which support running the following code:
> 
> require “socket”  
> do  
> require ‘socket’  
> puts $LOADED\_FEATURES
