# Fsockopen in ROR

**URL:** <https://www.ruby-forum.com/t/fsockopen-in-ror/177955>\
**Category:** Ruby\
**Created:** [October 27, 2009, 9:13am UTC](https://www.ruby-forum.com/t/fsockopen-in-ror/177955 "2009-10-27T09:13:34Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![simo](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/90db22/32.png) [@simo](https://www.ruby-forum.com/u/simo)\
**Post date:** [October 27, 2009, 9:13am UTC](https://www.ruby-forum.com/t/fsockopen-in-ror/177955/1 "2009-10-27T09:13:34Z")

</div>

Hi,

PHP has ‘fsockopen’-function to create a socket connection. With what  
function I can create this connection in ROR?

Thanks im Advance

---

<div class="post-metadata">

**Author:** ![simo](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/90db22/32.png) [@simo](https://www.ruby-forum.com/u/simo)\
**Post date:** [October 27, 2009, 10:09am UTC](https://www.ruby-forum.com/t/fsockopen-in-ror/177955/2 "2009-10-27T10:09:03Z")

</div>

Simoha S. wrote:

> PHP has ‘fsockopen’-function to create a socket connection. With what  
> function I can create this connection in ROR?

FYI: Rails is a web framework. Ruby is a programming language.

If you want to open a TCP connection in Ruby, start with the TCPSocket  
class.

[http://www.ruby-doc.org/docs/ProgrammingRuby/html/lib\_network.html](http://www.ruby-doc.org/docs/ProgrammingRuby/html/lib_network.html)  
[http://ruby-doc.org/core/classes/TCPSocket.html](http://ruby-doc.org/core/classes/TCPSocket.html)

There are also lower-level socket classes which can be used in special  
cases.

---

<div class="post-metadata">

**Author:** ![simo](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/90db22/32.png) [@simo](https://www.ruby-forum.com/u/simo)\
**Post date:** [November 4, 2009, 4:18pm UTC](https://www.ruby-forum.com/t/fsockopen-in-ror/177955/3 "2009-11-04T16:18:13Z")

</div>

Brian C., Thanks.
