#include <Client.h>
Inheritance diagram for Client:
Public Methods | |
Client () | |
Client (Socket *s) | |
void * | run () |
Very important You must override this method so you can provide the thread process itself whatever you define this method does in your subclass is what the thread will start doing when you call start() | |
~Client () | |
int | start () |
Call this method when you want to start running your thread. | |
void | killMe () |
This method detaches the thread from the current running program, just like detach() does. | |
char * | getClassName () |
Returns the name of the current class. | |
void | close (void) |
Closes the communications channel with the remote host inmmediately. | |
const int | getPort () |
Returns the port associated with this socket. | |
Socket & | operator<< (const char chr) |
Sends a char to the other host. | |
Socket & | operator<< (const int value) |
Sends an integer quantity to the remote host. | |
Socket & | operator<< (const unsigned int value) |
Sends an unsigned integer quantity to the remote host. | |
Socket & | operator<< (const float value) |
Sends a floating point value to the remote host. | |
Socket & | operator<< (const double value) |
Sends a double presicion value to the remote host. | |
Socket & | operator<< (const long double value) |
Sends a 96bit floating point value to the remote host. | |
Socket & | operator<< (const long value) |
Sends a long(32bit) quantity to the remote host. | |
Socket & | operator<< (const unsigned long value) |
Sends an unsigned long(32bit) quantity to the remote host. | |
Socket & | operator<< (const unsigned long long value) |
Sends a 64bit unsigned quantity to the remote host. | |
Socket & | operator<< (String str) |
Sends a string to the remote host. | |
void | write (const void *buffer, unsigned long size) |
Use this method when you need to send a fixed lenght buffer of bytes to the remote host, the routine will cut the buffer in chunks so the transfer can be safelly completed without out of memory error that might be caused if you attempt to send a very big buffer of data. | |
Socket & | operator>> (char &chr) |
Receives a char from the other host. | |
Socket & | operator>> (int &value) |
Receives an integer quantity from the remote host. | |
Socket & | operator>> (unsigned int &value) |
Receives an unsigned integer quantity from the remote host. | |
Socket & | operator>> (float &value) |
Receives a floating point value from the remote host. | |
Socket & | operator>> (double &value) |
Receives a double presicion value from the remote host. | |
Socket & | operator>> (long double &value) |
Receives a 96bit floating point value from the remote host. | |
Socket & | operator>> (long &value) |
Receives a long(32bit) quantity from the remote host. | |
Socket & | operator>> (unsigned long &value) |
Receives an unsigned long(32bit) quantity from the remote host. | |
Socket & | operator>> (unsigned long long &value) |
Receives a 64bit unsigned quantity from the remote host. | |
Socket & | operator>> (String &str) |
Receives a string from the remote host. | |
void | read (void *buffer, unsigned long size) |
Use this method when you need to receive a fixed lenght buffer of bytes from the remote host, the routine will cut the buffer in chunks so the transfer can be safelly completed without out of memory error that might be caused if you attempt to receive a very big buffer of data. | |
const int | getSocket () |
Returns the socket's file descriptor value. | |
int | setSoTimeout (int) |
Defines the timeout before closing connection to the other end of communication. | |
char * | getClassName () |
Returns the name of the current class. | |
Data Fields | |
bool | autodetach |
This variable is just for knowing if the thread can be autodetached or no, currently it does nothing, but is here for backward compatibility. | |
Protected Methods | |
int | _start () |
This is a wrapper and is intended to be used only for derived classes. | |
void | detach () |
This method detaches the thread from the current running program. | |
void | setClassName (char *n) |
Call this method when you need to set the name of the class you're creating, typically int it's constructor, remeber that you must set the classname for every clas you create, that way you can have more information while being in a debuging process. | |
int | CreateSocket (const String thehost, int theport) |
This routine creates the socket by calling socket(2) and resolving the argument thehost to its IP representation in case the address is given as a name, this socket is connected to the port theport. | |
int | setSockOption (int opname, void *optval, unsigned int siz) |
Is an interface to setsockopt. | |
int | setTCPOption (int opname, void *optval, unsigned int siz) |
void | setClassName (char *n) |
Call this method when you need to set the name of the class you're creating, typically int it's constructor, remeber that you must set the classname for every clas you create, that way you can have more information while being in a debuging process. | |
Protected Attributes | |
String | host |
Stores the hostname where the socket is going to be connected. | |
int | sock |
This file descriptor represents the socket itself as returned by socket(2) and accept(2). | |
int | port |
Defines the communications port used by the socket or the port which the socket server uses to listen requests. |
|
|
|
Definition at line 11 of file Client.cpp. |
|
|
|
This is a wrapper and is intended to be used only for derived classes.
Definition at line 44 of file Thread.cpp. References clawsoft.Thread.start(), and clawsoft.Thread.thread. |
|
Closes the communications channel with the remote host inmmediately.
Definition at line 160 of file Socket.cpp. References clawsoft.SocketBase.sock. |
|
This routine creates the socket by calling socket(2) and resolving the argument thehost to its IP representation in case the address is given as a name, this socket is connected to the port theport.
Definition at line 79 of file Socket.cpp. References clawsoft.addSigpipeHandler(), clawsoft.Socket.host, clawsoft.SocketBase.port, clawsoft.SocketBase.sock, and clawsoft.String.toCharPtr(). Referenced by clawsoft.Socket.Socket(). |
|
This method detaches the thread from the current running program.
Definition at line 33 of file Thread.cpp. References clawsoft.Thread.thread. Referenced by clawsoft.Thread.~Thread(). |
|
Returns the name of the current class.
Definition at line 18 of file Object.cpp. References clawsoft.Object.__cls_name. |
|
Returns the name of the current class.
Definition at line 18 of file Object.cpp. References clawsoft.Object.__cls_name. |
|
Returns the port associated with this socket.
Definition at line 74 of file Socket.h. References clawsoft.SocketBase.port. |
|
Returns the socket's file descriptor value.
Definition at line 38 of file SocketBase.h. References clawsoft.SocketBase.sock. |
|
This method detaches the thread from the current running program, just like detach() does.
Definition at line 54 of file Thread.cpp. References clawsoft.Thread.thread. |
|
Sends a string to the remote host.
Definition at line 212 of file Socket.cpp. References clawsoft.claw_delete_array(), clawsoft.String.size(), clawsoft.String.toCharPtr(), and clawsoft.Socket.write(). |
|
Sends a 64bit unsigned quantity to the remote host.
|
|
Sends an unsigned long(32bit) quantity to the remote host.
Definition at line 202 of file Socket.cpp. |
|
Sends a long(32bit) quantity to the remote host.
|
|
Sends a 96bit floating point value to the remote host.
Definition at line 192 of file Socket.cpp. |
|
Sends a double presicion value to the remote host.
Definition at line 187 of file Socket.cpp. |
|
Sends a floating point value to the remote host.
Definition at line 182 of file Socket.cpp. |
|
Sends an unsigned integer quantity to the remote host.
Definition at line 177 of file Socket.cpp. |
|
Sends an integer quantity to the remote host.
Definition at line 172 of file Socket.cpp. |
|
Sends a char to the other host.
Definition at line 167 of file Socket.cpp. |
|
Receives a string from the remote host.
Definition at line 332 of file Socket.cpp. References clawsoft.Socket.read(), READ_TIMEOUT, and clawsoft.SocketBase.sock. |
|
Receives a 64bit unsigned quantity from the remote host.
Definition at line 327 of file Socket.cpp. |
|
Receives an unsigned long(32bit) quantity from the remote host.
Definition at line 322 of file Socket.cpp. |
|
Receives a long(32bit) quantity from the remote host.
Definition at line 317 of file Socket.cpp. |
|
Receives a 96bit floating point value from the remote host.
Definition at line 312 of file Socket.cpp. |
|
Receives a double presicion value from the remote host.
Definition at line 307 of file Socket.cpp. |
|
Receives a floating point value from the remote host.
Definition at line 302 of file Socket.cpp. |
|
Receives an unsigned integer quantity from the remote host.
Definition at line 297 of file Socket.cpp. |
|
Receives an integer quantity from the remote host.
Definition at line 292 of file Socket.cpp. |
|
Receives a char from the other host.
Definition at line 287 of file Socket.cpp. |
|
Use this method when you need to receive a fixed lenght buffer of bytes from the remote host, the routine will cut the buffer in chunks so the transfer can be safelly completed without out of memory error that might be caused if you attempt to receive a very big buffer of data.
Definition at line 358 of file Socket.cpp. References READ_TIMEOUT, clawsoft.SocketBase.sock, and SOCK_CHUNK_SIZE. Referenced by clawsoft.Socket.operator>>(). |
|
Very important
Implements clawsoft.Thread. Definition at line 15 of file Client.cpp. References Protocol.attend(), CLIENT, and counter. |
|
|
|
Is an interface to setsockopt.
Definition at line 13 of file SocketBase.cpp. References clawsoft.SocketBase.sock. Referenced by clawsoft.SocketBase.setSoTimeout(). |
|
Defines the timeout before closing connection to the other end of communication.
Definition at line 28 of file SocketBase.cpp. References clawsoft.SocketBase.setSockOption(). |
|
Definition at line 23 of file SocketBase.cpp. |
|
Call this method when you want to start running your thread.
Definition at line 22 of file Thread.cpp. References clawsoft.Thread.runMethod(), and clawsoft.Thread.thread. Referenced by clawsoft.Thread._start(), and Server.start(). |
|
Use this method when you need to send a fixed lenght buffer of bytes to the remote host, the routine will cut the buffer in chunks so the transfer can be safelly completed without out of memory error that might be caused if you attempt to send a very big buffer of data.
Definition at line 229 of file Socket.cpp. References clawsoft.SocketBase.sock, and SOCK_CHUNK_SIZE. Referenced by clawsoft.Socket.operator<<(). |
|
This variable is just for knowing if the thread can be autodetached or no, currently it does nothing, but is here for backward compatibility.
|
|
Stores the hostname where the socket is going to be connected.
Definition at line 25 of file Socket.h. Referenced by clawsoft.Socket.CreateSocket(), and clawsoft.Socket.Socket(). |
|
Defines the communications port used by the socket or the port which the socket server uses to listen requests.
Definition at line 27 of file SocketBase.h. Referenced by clawsoft.ServerSocket.accept(), clawsoft.Socket.CreateSocket(), clawsoft.ServerSocket.CreateSocket(), clawsoft.Socket.getPort(), clawsoft.ServerSocket.getPort(), clawsoft.Socket.operator=(), and clawsoft.Socket.Socket(). |
|
This file descriptor represents the socket itself as returned by socket(2) and accept(2).
Definition at line 22 of file SocketBase.h. Referenced by clawsoft.ServerSocket.accept(), clawsoft.Socket.close(), clawsoft.ServerSocket.close(), clawsoft.Socket.CreateSocket(), clawsoft.ServerSocket.CreateSocket(), clawsoft.SocketBase.getSocket(), clawsoft.Socket.operator=(), clawsoft.Socket.operator>>(), clawsoft.Socket.read(), clawsoft.SocketBase.setSockOption(), clawsoft.Socket.Socket(), and clawsoft.Socket.write(). |
Powered by: