Socket
Book a DemoInstallSign in
Socket

mockets

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mockets

0.0.1
bundlerRubygems
Version published
Maintainers
1
Created
Source

mockets

Mock socket library for testing network applications

Reset all mock sockets to default of connection refused

Mocket.reset!
Mocket.open('10.10.10.10', 25)
Exception: Errno:ECONNREFUSED

Set a host/port to host unreachable

Mocket.hostunreachable('10.10.10.20', 25)
Mocket.open('10.10.10.20', 25)
Exception: Errno::EHOSTUNREACH

Set a host/port to connection timed out

Mocket.timeout('10.10.20.20', 25)
Mocket.open('10.10.20.20', 25)
Exception: Errno::ETIMEDOUT

Set a host/port to return an open mocket

Mocket.listen('10.10.10.30', 25)
mocket = Mocket.open('10.10.10.30', 25)
number_bytes_written = mocket.write('some message here')
mocket.close

FAQs

Package last updated on 19 Aug 2013

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.