Homepage | Demos | Overview | Downloads | Tutorials | Reference | Credits |
#include <Socket.h>
For more information on using wireless, please read the following tutorials:
Definition at line 47 of file Socket.h.
Public Member Functions | |
Socket (int sockn) | |
constructor | |
~Socket () | |
destructor | |
byte * | getWriteBuffer (int bytesreq) |
void | write (int size) |
writes the specified number of bytes starting at the pointer returned. | |
int | read () |
Blocking read. | |
byte * | getReadBuffer () |
getReadBuffer is used with blocking read's | |
void | init () |
initialize socket member variables. This is different from the constructor since sockets are reused | |
int | setFlushType (FlushType_t fType) |
Chooses between blocking and non-blocking input, output. | |
void | setTextForward () |
causes this socket to forward output to stdout if it is not connected, call setForward(NULL) to unset | |
void | setForward (Socket *forsock) |
causes this socket to forward output to sock if it is not connected, pass NULL to unset | |
void | setVerbosity (int verbose) |
Picks a level of verbosity for filtering pprintf commands. | |
int | write (const byte *buf, int size) |
int | read (byte *buf, int size) |
Blocking read. | |
int | printf (const char *fmt,...) |
int | vprintf (const char *fmt, va_list al) |
int | pprintf (int vlevel, const char *fmt,...) |
Similar to printf, except it takes an extra first argument. | |
void | flush () |
Public Attributes | |
int | sock |
unique non-negative integer representing socket. Serves as index into socket Objects array | |
Private Member Functions | |
Socket (const Socket &) | |
copy constructor, don't call | |
Socket & | operator= (const Socket &) |
assignment operator, don't call | |
Private Attributes | |
TransportType_t | trType |
private ALOKL_TODO | |
FlushType_t | flType |
private ALOKL_TODO | |
int | verbosity |
private ALOKL_TODO | |
antModuleRef | endpoint |
private ALOKL_TODO | |
ConnectionState | state |
private ALOKL_TODO | |
int | sendBufSize |
private ALOKL_TODO | |
int | recvBufSize |
private ALOKL_TODO | |
int | sendSize |
private ALOKL_TODO | |
int | recvSize |
private ALOKL_TODO | |
int | writeSize |
private ALOKL_TODO | |
int | readSize |
private ALOKL_TODO | |
bool | tx |
private ALOKL_TODO | |
bool | rx |
private ALOKL_TODO | |
antSharedBuffer | sendBuffer |
private ALOKL_TODO | |
antSharedBuffer | recvBuffer |
private ALOKL_TODO | |
byte * | sendData |
private ALOKL_TODO | |
byte * | recvData |
private ALOKL_TODO | |
byte * | readData |
private ALOKL_TODO | |
byte * | writeData |
private ALOKL_TODO | |
int | server_port |
private ALOKL_TODO | |
int(* | rcvcbckfn )(char *, int) |
private ALOKL_TODO | |
bool | textForward |
private ALOKL_TODO | |
char * | textForwardBuf |
private ALOKL_TODO | |
Socket * | forwardSock |
private ALOKL_TODO | |
Friends | |
class | Wireless |
|
constructor
Definition at line 55 of file Socket.h. References SocketNS::CONNECTION_CLOSED, endpoint, flType, SocketNS::FLUSH_NONBLOCKING, forwardSock, rcvcbckfn, readData, readSize, recvBuffer, recvBufSize, recvData, recvSize, rx, sendBuffer, sendBufSize, sendData, sendSize, server_port, sock, state, textForward, textForwardBuf, trType, tx, verbosity, writeData, and writeSize. |
|
destructor
|
|
copy constructor, don't call
|
|
All write commands on the socket will implicity call this. You don't need to call it, unless you're implementing your own write Definition at line 66 of file Socket.cc. References Wireless::blockingSend(), SocketNS::CONNECTION_CONNECTED, flType, SocketNS::FLUSH_NONBLOCKING, forwardSock, Wireless::send(), sendData, sendSize, sock, state, tx, wireless, writeData, and writeSize. |
|
getReadBuffer is used with blocking read's The read(void) and getReadBuffer combo eliminates one buffer copy. You don't need to use getReadBuffer with read(byte*, int) Blocking read is currently broken - it will be fixed in the next release
|
|
The getWriteBuffer-write(int) combo eliminates one buffer copy. You don't need to use getWriteBuffer with write(byte*, int)
Definition at line 11 of file Socket.cc. References SocketNS::CONNECTION_CONNECTED, forwardSock, sendBufSize, state, state, textForward, textForwardBuf, writeData, and writeSize. |
|
initialize socket member variables. This is different from the constructor since sockets are reused
|
|
assignment operator, don't call
|
|
Similar to printf, except it takes an extra first argument. If vlevel is than or equal to the current verbosity level, the string will be printed else it will be ignored
|
|
It's standard stuff. man 3 printf on most systems should give you more information Definition at line 105 of file Socket.cc. References vprintf(). |
|
Blocking read. You might want to consider the read(void) and getReadBuffer combo if you call this often Blocking read is currently broken - it will be fixed in the next release
|
|
Blocking read. Tries to read upto receive buffer size worth of data from this socket. Blocking read is currently broken - it will be fixed in the next release
|
|
Chooses between blocking and non-blocking input, output. This function can only be called when a socket is disconnected, since it is a bad idea to mix blocking and non-blocking input, output. The default for a socket is non-blocking
Definition at line 58 of file Socket.cc. References SocketNS::CONNECTION_CLOSED, flType, and state. |
|
causes this socket to forward output to sock if it is not connected, pass NULL to unset
Definition at line 116 of file Socket.h. References forwardSock, and textForward. |
|
causes this socket to forward output to stdout if it is not connected, call setForward(NULL) to unset
Definition at line 113 of file Socket.h. References forwardSock, and textForward. |
|
Picks a level of verbosity for filtering pprintf commands. The higher the verbosity, the more the number of messages printed. This is useful for filtering out non-important messages with very little processor cost. Default is 0.
Definition at line 125 of file Socket.h. References verbosity. |
|
It's standard stuff. man 3 printf on most systems should give you more information Definition at line 115 of file Socket.cc. References SocketNS::CONNECTION_CONNECTED, flush(), forwardSock, sendBufSize, state, textForward, writeData, and writeSize. |
|
You might want to consider the getWriteBuffer-write(int) combo if you call this often
Definition at line 138 of file Socket.cc. References SocketNS::CONNECTION_CONNECTED, forwardSock, getWriteBuffer(), state, textForward, and write(). |
|
writes the specified number of bytes starting at the pointer returned. in a (prior) call to getWriteBufer
Definition at line 26 of file Socket.cc. References flush(), textForwardBuf, and writeSize. |
|
|
|
private ALOKL_TODO
|
|
private ALOKL_TODO
|
|
private ALOKL_TODO
|
|
private ALOKL_TODO
|
|
private ALOKL_TODO
|
|
private ALOKL_TODO
|
|
private ALOKL_TODO
|
|
private ALOKL_TODO
|
|
private ALOKL_TODO
|
|
private ALOKL_TODO
|
|
private ALOKL_TODO
|
|
private ALOKL_TODO
|
|
private ALOKL_TODO
|
|
private ALOKL_TODO
|
|
private ALOKL_TODO
|
|
private ALOKL_TODO
|
|
unique non-negative integer representing socket. Serves as index into socket Objects array
|
|
private ALOKL_TODO
|
|
private ALOKL_TODO
|
|
private ALOKL_TODO
|
|
private ALOKL_TODO
|
|
private ALOKL_TODO
|
|
private ALOKL_TODO
|
|
private ALOKL_TODO
|
|
private ALOKL_TODO
|
Tekkotsu v1.4 |
Generated Sat Jul 19 00:09:10 2003 by Doxygen 1.3.2 |