mirror of
https://github.com/ruby/ruby.git
synced 2025-08-25 05:55:46 +02:00
* backport r32977 from trunk
* ext/socket: Make Socket documentation appear. Add documentation for Socket, TCPServer, SOCKSSocket. Patch by Sylvain Daubert. [Ruby 1.9 - Feature #5182] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_3@32979 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
28d8d87812
commit
82322e5d4b
16 changed files with 253 additions and 103 deletions
|
@ -11,6 +11,13 @@
|
|||
#include "rubysocket.h"
|
||||
|
||||
#ifdef SOCKS
|
||||
/*
|
||||
* call-seq:
|
||||
* SOCKSSocket.new(host, serv) => socket
|
||||
*
|
||||
* Opens a SOCKS connection to +host+ via the SOCKS server +serv+.
|
||||
*
|
||||
*/
|
||||
static VALUE
|
||||
socks_init(VALUE sock, VALUE host, VALUE serv)
|
||||
{
|
||||
|
@ -25,6 +32,10 @@ socks_init(VALUE sock, VALUE host, VALUE serv)
|
|||
}
|
||||
|
||||
#ifdef SOCKS5
|
||||
/*
|
||||
* Closes the SOCKS connection.
|
||||
*
|
||||
*/
|
||||
static VALUE
|
||||
socks_s_close(VALUE sock)
|
||||
{
|
||||
|
@ -40,15 +51,17 @@ socks_s_close(VALUE sock)
|
|||
#endif
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Document-class: ::SOCKSSocket < TCPSocket
|
||||
*
|
||||
* SOCKSSocket class
|
||||
*/
|
||||
void
|
||||
rsock_init_sockssocket(void)
|
||||
{
|
||||
#ifdef SOCKS
|
||||
/*
|
||||
* Document-class: SOCKSSocket < TCPSocket
|
||||
*
|
||||
* SOCKS is an Internet protocol that routes packets between a client and
|
||||
* a server through a proxy server. SOCKS5, if supported, additionally
|
||||
* provides authentication so only authorized users may access a server.
|
||||
*/
|
||||
rb_cSOCKSSocket = rb_define_class("SOCKSSocket", rb_cTCPSocket);
|
||||
rb_define_method(rb_cSOCKSSocket, "initialize", socks_init, 2);
|
||||
#ifdef SOCKS5
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue