Main Page   Modules   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   Related Pages  

KSocks Class Reference

Access to a SOCKS Proxy. More...

#include <ksocks.h>

List of all members.

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 ()

Static Public Methods

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


Detailed Description

Access to a SOCKS Proxy.

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().

Definition at line 44 of file ksocks.h.


Member Function Documentation

int KSocks::accept (  int    s,
sockaddr *    addr,
ksocklen_t *    addrlen
) 
 

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

bool KSocks::activated (    )  [static]
 

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

Returns:
true if activated

int KSocks::bind (  int    sockfd,
sockaddr *    my_addr,
ksocklen_t    addrlen
) 
 

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

int KSocks::connect (  int    sockfd,
const sockaddr *    serv_addr,
ksocklen_t    addrlen
) 
 

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

void KSocks::die (    ) 
 

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

void KSocks::disable (    )  [static]
 

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

void KSocks::disableSocks (    ) 
 

Disable the use of SOCKS immediately

void KSocks::enableSocks (    ) 
 

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

int KSocks::getpeername (  int    s,
sockaddr *    name,
ksocklen_t *    namelen
) 
 

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

int KSocks::getsockname (  int    s,
sockaddr *    name,
ksocklen_t *    namelen
) 
 

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

bool KSocks::hasSocks (    ) 
 

Checks whether SOCKS is available for use.

Returns:
true if SOCKS is available for use.

bool KSocks::hasWorkingAsyncConnect (    ) 
 

Returns whether asynchronous connects work with the selected SOCKS impementation

int KSocks::listen (  int    s,
int    backlog
) 
 

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

signed long int KSocks::read (  int    fd,
void *    buf,
unsigned long int    count
) 
 

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

int KSocks::recv (  int    s,
void *    buf,
unsigned long int    len,
int    flags
) 
 

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

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

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

int KSocks::select (  int    n,
fd_set *    readfds,
fd_set *    writefds,
fd_set *    exceptfds,
struct timeval *    timeout
) 
 

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

KSocks* KSocks::self (    )  [static]
 

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

Returns:
the KSock instance

int KSocks::send (  int    s,
const void *    msg,
unsigned long int    len,
int    flags
) 
 

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

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

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

void KSocks::setConfig (  KConfigBase *    config )  [static]
 

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

bool KSocks::usingSocks (    ) 
 

Checks whether SOCKS is currently being used.

Returns:
true if SOCKS is currently being used.

signed long int KSocks::write (  int    fd,
const void *    buf,
unsigned long int    count
) 
 

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


The documentation for this class was generated from the following file:
Generated on Wed Aug 13 23:30:24 2003 for kdelibs by doxygen1.2.18