class KSocks

# class KSocks | Access to a SOCKS Proxy. More...
Definition | `#include <ksocks.h>`
List of all Methods
Annotated List
Files
Globals
Hierarchy
Index

#### Public Methods

- void disableSocks ()
- void enableSocks ()
- bool usingSocks ()
- bool hasSocks ()
- bool hasWorkingAsyncConnect ()
- int connect (int sockfd, const sockaddr *serv_addr, ksocklen_t addrlen)
- signed long int read (int fd, void *buf, unsigned long int count)
- signed long int write (int fd, const void *buf, unsigned long int count)
- int recvfrom (int s, void *buf, unsigned long int len, int flags, sockaddr *from, ksocklen_t *fromlen)
- int sendto (int s, const void *msg, unsigned long int len, int flags, const sockaddr *to, ksocklen_t tolen)
- int recv (int s, void *buf, unsigned long int len, int flags)
- int send (int s, const void *msg, unsigned long int len, int flags)
- int getsockname (int s, sockaddr *name, ksocklen_t *namelen)
- int getpeername (int s, sockaddr *name, ksocklen_t *namelen)
- int accept (int s, sockaddr *addr, ksocklen_t *addrlen)
- int select (int n, fd_set *readfds, fd_set *writefds, fd_set *exceptfds, struct timeval *timeout)
- int listen (int s, int backlog)
- int bind (int sockfd, sockaddr *my_addr, ksocklen_t addrlen)
- void die ()

#### Public Static Methods

- static KSocks * self ()
- static bool activated ()
- static void disable ()
- static void setConfig (KConfigBase *config)

## Detailed Description

This class provides you with an interface to a SOCKS Proxy server. A SOCKS server is able to provide full internet access behind a firewall. KSocks is a singleton; there can only be one instance at any given time. To obtain a reference to that instance, use self().

KSocks * self () | ### self

[static]

Return an instance of class KSocks *. You cannot delete this object. It is a singleton class.

Returns: the KSock instance

bool activated () | ### activated

[static]

Checks whether KSocks has been started (ie someone called self())

Returns: true if activated

void disableSocks () | ### disableSocks

Disable the use of SOCKS immediately

void enableSocks () | ### enableSocks

Enable the use of SOCKS immediately if hasSocks() is true.

bool usingSocks () | ### usingSocks

Checks whether SOCKS is currently being used.

Returns: true if SOCKS is currently being used.

bool hasSocks () | ### hasSocks

Checks whether SOCKS is available for use.

Returns: true if SOCKS is available for use.

bool hasWorkingAsyncConnect () | ### hasWorkingAsyncConnect

Returns whether asynchronous connects work with the selected SOCKS impementation

int connect (int sockfd, const sockaddr *serv_addr, ksocklen_t addrlen) | ### connect

This is the re-implementation of libc's function of the same name. Read the appropriate man page.

signed long int read (int fd, void *buf, unsigned long int count) | ### read

This is the re-implementation of libc's function of the same name. Read the appropriate man page.

signed long int write (int fd, const void *buf, unsigned long int count) | ### write

This is the re-implementation of libc's function of the same name. Read the appropriate man page.

int recvfrom (int s, void *buf, unsigned long int len, int flags, sockaddr *from, ksocklen_t *fromlen) | ### recvfrom

This is the re-implementation of libc's function of the same name. Read the appropriate man page.

int sendto (int s, const void *msg, unsigned long int len, int flags, const sockaddr *to, ksocklen_t tolen) | ### sendto

This is the re-implementation of libc's function of the same name. Read the appropriate man page.

int recv (int s, void *buf, unsigned long int len, int flags) | ### recv

This is the re-implementation of libc's function of the same name. Read the appropriate man page.

int send (int s, const void *msg, unsigned long int len, int flags) | ### send

This is the re-implementation of libc's function of the same name. Read the appropriate man page.

int getsockname (int s, sockaddr *name, ksocklen_t *namelen) | ### getsockname

This is the re-implementation of libc's function of the same name. Read the appropriate man page.

int getpeername (int s, sockaddr *name, ksocklen_t *namelen) | ### getpeername

This is the re-implementation of libc's function of the same name. Read the appropriate man page.

int accept (int s, sockaddr *addr, ksocklen_t *addrlen) | ### accept

This is the re-implementation of libc's function of the same name. Read the appropriate man page.

int select (int n, fd_set *readfds, fd_set *writefds, fd_set *exceptfds, struct timeval *timeout) | ### select

This is the re-implementation of libc's function of the same name. Read the appropriate man page.

int listen (int s, int backlog) | ### listen

This is the re-implementation of libc's function of the same name. Read the appropriate man page.

int bind (int sockfd, sockaddr *my_addr, ksocklen_t addrlen) | ### bind

This is the re-implementation of libc's function of the same name. Read the appropriate man page.

void die () | ### die

If you're using this, you're probably doing something wrong. Please don't use it.

void disable () | ### disable

[static]

Set this before the first call to KSocks::self() and it will fail to initialize SOCKS.

void setConfig (KConfigBase *config) | ### setConfig

[static]

Set this before the first call to KSocks::self() and it will use `config` to read its configuration from.

Generated by: root on macppc.ports.openbsd.org on Sat Sep 6 10:36:15 2003, using kdoc 2.0a54.