| Tekkotsu Homepage | Demos | Overview | Downloads | Dev. Resources | Reference | Credits |
Socket Class Reference#include <Socket.h>
Inheritance diagram for Socket: ![]() Detailed DescriptionTekkotsu wireless Socket class.For more information on using wireless, please read the following tutorials:
The networking interface needs more documentation. It also needs a cleanup. In the mean time, take a look at the TekkotsuMon objects in Tekkotsu
Definition at line 76 of file Socket.h.
Member Typedef Documentation
Constructor & Destructor Documentation
copy constructor, don't call
Member Function Documentation
All write commands on the socket will implicity call this. You don't need to call it, unless you're implementing your own write Reimplemented in DummySocket. Definition at line 156 of file Socket.cc. Referenced by flush(), Wireless::SendCont(), vprintf(), and write().
returns the address of the remote host as a human-readable string
Definition at line 264 of file Socket.cc. Referenced by EchoBehavior::processCallback().
returns the port number that the remote host's socket is on
Definition at line 222 of file Socket.h. Referenced by EchoBehavior::processCallback().
getReadBuffer is used with blocking read's NOT IMPLEMENTED 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
Reimplemented in DummySocket.
returns the transport in use
Definition at line 156 of file Socket.h. Referenced by SegCamBehavior::processEvent(), RegionCamBehavior::processEvent(), and RawCamBehavior::processEvent().
The getWriteBuffer-write(int) combo eliminates one buffer copy. You don't need to use getWriteBuffer with write(byte*, int)
Reimplemented in DummySocket. Definition at line 45 of file Socket.cc. Referenced by LGmixin::displayHtmlText(), getWriteBuffer(), EventLogger::logImage(), EventLogger::logMessage(), EventLogger::logWebcam(), SegCamBehavior::openPacket(), RegionCamBehavior::openPacket(), RawCamBehavior::openPacket(), WorldStateSerializerBehavior::processEvent(), MicrophoneServer::processEvent(), EventLogger::processEvent(), WMMonitorBehavior::report(), DumpFileControl::selectedFile(), SegCamBehavior::sendCloseConnectionPacket(), RawCamBehavior::sendCloseConnectionPacket(), CameraStreamBehavior::sendSensors(), LGmixin::uploadCameraImage(), LGmixin::uploadFile(), and write().
initialize socket member variables. This is different from the constructor since sockets are reused
Reimplemented in DummySocket. Definition at line 109 of file Socket.cc. Referenced by Wireless::connect(), Wireless::listen(), and setTransport().
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.
Reimplemented in DummySocket.
It's standard stuff. man 3 printf on most systems should give you more information Reimplemented in DummySocket. Definition at line 199 of file Socket.cc. Referenced by ProfilerCheckControl::activate(), HelpControl::activate(), BehaviorReportControl::activate(), BatteryCheckControl::activate(), WalkCalibration::addSample(), PNGGenerator::calcImage(), JPEGGenerator::calcImage(), StewartPlatformBehavior::callback(), SensorObserverControl::checkLogFile(), EventLogger::checkLogFile(), ControlBase::clearMenu(), StewartPlatformBehavior::closeComm(), Controller::closeGUI(), ProjectInterface::displayException(), LGmixin::displayHtmlFile(), LGmixin::displayHtmlText(), LGmixin::displayImageFile(), ControlBase::doReadStdIn(), WalkCalibration::doSelect(), ValueEditControl< T >::doSelect(), ControlBase::doSelect(), StateNode::DoStart(), StateNode::DoStop(), Controller::DoStop(), HeadPointerMC::ensureValidJoint(), WalkCalibration::err(), FreeMemReportControl::freeMem(), PNGGenerator::getBinSize(), JPEGGenerator::getBinSize(), Kinematics::getInterestPoint(), SpiderMachineBehavior::indent(), EventLogger::indent(), Controller::init(), Kinematics::initStatics(), PostureMC::isAlive(), HeadPointerMC::isAlive(), StewartPlatformBehavior::isConnected(), WalkMC::loadBuffer(), SegmentedColorGenerator::loadBuffer(), RLEGenerator::loadBuffer(), RegionGenerator::loadBuffer(), RawCameraGenerator::loadBuffer(), PNGGenerator::loadBuffer(), JPEGGenerator::loadBuffer(), InterleavedYUVGenerator::loadBuffer(), CDTGenerator::loadBuffer(), SegmentedColorGenerator::loadColorInfo(), WalkCalibration::loadData(), SegmentedColorGenerator::loadThresholdMap(), Kinematics::lookup(), Kinematics::newChain(), MotionSequenceMC< MAXMOVE >::newKeyFrame(), ValueEditControl< T >::pause(), Controller::pop(), pprintf(), EchoBehavior::processCallback(), WalkCalibration::processEvent(), ValueEditControl< T >::processEvent(), SpiderMachineBehavior::processEvent(), SensorObserverControl::processEvent(), SegCamBehavior::processEvent(), RegionGenerator::processEvent(), RawCameraGenerator::processEvent(), RawCamBehavior::processEvent(), PostureEditor::processEvent(), FreeMemReportControl::processEvent(), FlashIPAddrBehavior::processEvent(), FilterBankGenerator::processEvent(), EventLogger::processEvent(), EStopControllerBehavior::processEvent(), EchoBehavior::processEvent(), CDTGenerator::processEvent(), BallDetectionGenerator::processEvent(), EventLogger::processStateMachineEvent(), Controller::push(), LoadCalibration::readData(), LoadCalibration::readMaxs(), CameraStreamBehavior::receiveData(), WaypointWalkControl::refresh(), WalkCalibration::refresh(), ValueEditControl< T >::refresh(), NetworkStatusControl::refresh(), FilterBankGenerator::refresh(), ControlBase::refresh(), RegionGenerator::RegionGenerator(), WMMonitorBehavior::registerData(), WMMonitorBehavior::report(), WalkCalibration::report(), HelpControl::report(), FreeMemReportControl::report(), BatteryCheckControl::report(), SpiderMachineBehavior::runCommand(), EventLogger::runCommand(), EStopControllerBehavior::runCommand(), SegmentedColorGenerator::saveBuffer(), RLEGenerator::saveBuffer(), RegionGenerator::saveBuffer(), RawCameraGenerator::saveBuffer(), PNGGenerator::saveBuffer(), JPEGGenerator::saveBuffer(), InterleavedYUVGenerator::saveBuffer(), CDTGenerator::saveBuffer(), WalkCalibration::saveData(), RawCameraGenerator::saveFileStream(), StewartPlatformBehavior::sax_error(), StewartPlatformBehavior::sax_fatal_error(), StewartPlatformBehavior::sax_start_element(), StewartPlatformBehavior::sax_warning(), LoadWalkControl::selectedFile(), DumpFileControl::selectedFile(), LGmixin::sendCommand(), CameraStreamBehavior::sendSensors(), StewartPlatformBehavior::setParam(), WalkCalibration::setupMoving(), SegCamBehavior::setupServer(), RegionCamBehavior::setupServer(), RawCamBehavior::setupServer(), SpiderMachineBehavior::spider(), EventLogger::spider(), BatteryMonitorBehavior::startWarning(), BatteryMonitorBehavior::stopWarning(), SaveWalkControl::takeInput(), ControlBase::takeInput(), Controller::takeLine(), EmergencyStopMC::trigger(), LGmixin::uploadCameraImage(), LGmixin::uploadFile(), write(), and StateNode::~StateNode().
Blocking read (NOT IMPLEMENTED). 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
Reimplemented in DummySocket.
Blocking read. NOT IMPLEMENTED. 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
Reimplemented in DummySocket.
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
Reimplemented in DummySocket.
causes this socket to forward output to stdout if it is not connected, call setForward(NULL) to unset
Reimplemented in DummySocket.
can choose between different transports; will reset the socket
Definition at line 20 of file Socket.cc. Referenced by Wireless::socket().
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.
Reimplemented in DummySocket.
It's standard stuff. man 3 printf on most systems should give you more information Reimplemented in DummySocket. Definition at line 209 of file Socket.cc. Referenced by printf(), StewartPlatformBehavior::sax_error(), StewartPlatformBehavior::sax_fatal_error(), StewartPlatformBehavior::sax_warning(), and vprintf().
You might want to consider the getWriteBuffer-write(int) combo if you call this often
Reimplemented in DummySocket.
writes the specified number of bytes starting at the pointer returned. in a (prior) call to getWriteBufer
Reimplemented in DummySocket. Definition at line 70 of file Socket.cc. Referenced by SegCamBehavior::closePacket(), RegionCamBehavior::closePacket(), RawCamBehavior::closePacket(), LGmixin::displayHtmlText(), StringInputControl::doReadStdIn(), Controller::loadGUI(), EventLogger::logImage(), EventLogger::logMessage(), EventLogger::logWebcam(), WorldStateSerializerBehavior::processEvent(), MicrophoneServer::processEvent(), EventLogger::processEvent(), ControlBase::refresh(), BatteryCheckControl::refresh(), WMMonitorBehavior::report(), DumpFileControl::selectedFile(), SegCamBehavior::sendCloseConnectionPacket(), RawCamBehavior::sendCloseConnectionPacket(), CameraStreamBehavior::sendSensors(), LGmixin::uploadCameraImage(), LGmixin::uploadFile(), and write().
Friends And Related Function Documentation
Member Data Documentation
if true, the socket will automatically be reopened after any closure (manual or otherwise)
Definition at line 269 of file Socket.h. Referenced by Wireless::getDaemon(), getDaemon(), and Wireless::setDaemon().
holds the endpoint data structure for the host OS
Definition at line 238 of file Socket.h. Referenced by Wireless::connect(), init(), Wireless::listen(), setTransport(), Socket(), and ~Socket().
blocking or non-blocking flushes... note that blocking flushes only block on the handoff to the system, not actual transmission (at least under aperios)
Definition at line 226 of file Socket.h. Referenced by flush(), getFlushType(), and setFlushType().
if non-NULL, output will be sent to this socket if the current socket is not otherwise connected (overrides textForward)
Definition at line 267 of file Socket.h. Referenced by flush(), getWriteBuffer(), setForward(), setTextForward(), vprintf(), and write().
inet address of peer (if connected) or last message sender (if udp and bound); -1 otherwise (in host byte-order, not network byte-order!)
Definition at line 262 of file Socket.h. Referenced by Wireless::close(), Wireless::CloseCont(), Wireless::connect(), getPeerAddress(), getPeerAddressAsString(), init(), Wireless::ListenCont(), and Wireless::ReceiveCont().
port of peer (if connected) or last message sender (if udp and bound); -1 otherwise
Definition at line 263 of file Socket.h. Referenced by Wireless::close(), Wireless::CloseCont(), Wireless::connect(), getPeerPort(), init(), Wireless::ListenCont(), and Wireless::ReceiveCont().
pointer to callback function, called after recvData has been filled in
Referenced by Wireless::receive(), Wireless::ReceiveCont(), and Wireless::setReceiver().
not used (available for double buffering, but not implemented)
Definition at line 257 of file Socket.h. Referenced by Wireless::socket().
under aperios, a pointer to a shared region with the ip stack; under other OS, a pointer to a normal char * buffer
Definition at line 255 of file Socket.h. Referenced by Wireless::close(), Wireless::socket(), and ~Socket().
the size of the buffer for readData and recvData
Definition at line 242 of file Socket.h. Referenced by getAvailableReceiveSize(), getMaxReceiveSize(), and Wireless::socket().
a region within recvBuffer, holding data either just filled in by ip stack (during call to rcvcbckfn), or in the process of being filled in (any other time)
Definition at line 256 of file Socket.h. Referenced by Wireless::ReceiveCont(), and Wireless::socket().
the size of recvData (total amount of data returned by system)
Definition at line 245 of file Socket.h. Referenced by Wireless::ReceiveCont().
not used, see readData
Definition at line 249 of file Socket.h. Referenced by Wireless::hasData(), and Wireless::receive().
under aperios, a pointer to a shared region with the ip stack; under other OS, a pointer to a normal char * buffer
Definition at line 251 of file Socket.h. Referenced by Wireless::close(), Wireless::socket(), and ~Socket().
the size of the buffer for sendData and writeData
Definition at line 241 of file Socket.h. Referenced by getAvailableSendSize(), getMaxSendSize(), getWriteBuffer(), Wireless::socket(), and vprintf().
a region within sendBuffer, holding data in the process of being sent
Definition at line 252 of file Socket.h. Referenced by flush(), and Wireless::socket().
the size of sendData (total amount of data from last flush)
Definition at line 243 of file Socket.h. Referenced by Wireless::blockingSend(), flush(), init(), and Wireless::send().
if the socket is a server socket, this is the port it is listening on
Definition at line 259 of file Socket.h. Referenced by Wireless::listen().
unique non-negative integer representing socket. Serves as index into socket Objects array
Definition at line 80 of file Socket.h. Referenced by Wireless::close(), SegCamBehavior::closeServer(), RegionCamBehavior::closeServer(), RawCamBehavior::closeServer(), Wireless::connect(), Controller::console_callback(), StringInputControl::doReadStdIn(), ControlBase::doReadStdIn(), WMMonitorBehavior::DoStart(), WalkControllerBehavior::DoStart(), UPennWalkControllerBehavior::DoStart(), StewartPlatformBehavior::DoStart(), SpiderMachineBehavior::DoStart(), SpeakerServer::DoStart(), MicrophoneServer::DoStart(), HeadPointControllerBehavior::DoStart(), EStopControllerBehavior::DoStart(), Controller::DoStart(), flush(), Wireless::getDaemon(), Wireless::listen(), EventLogger::logImage(), EventLogger::logMessage(), EventLogger::logWebcam(), WorldStateSerializerBehavior::processEvent(), SpiderMachineBehavior::processEvent(), SegCamBehavior::processEvent(), RegionCamBehavior::processEvent(), RawCamBehavior::processEvent(), MicrophoneServer::processEvent(), EventLogger::processEvent(), EchoBehavior::processEvent(), ConnectionMadeTrans::processEvent(), EventLogger::processStateMachineEvent(), WalkCalibration::refresh(), ValueEditControl< T >::refresh(), ControlBase::refresh(), BatteryCheckControl::refresh(), Wireless::setDaemon(), Wireless::setReceiver(), EchoBehavior::setupNetwork(), LGmixin::uploadFile(), and LGmixin::~LGmixin().
an enum representing the current state of the socket
Definition at line 239 of file Socket.h. Referenced by Wireless::BindCont(), Wireless::close(), Wireless::CloseCont(), Wireless::connect(), Wireless::ConnectCont(), flush(), getWriteBuffer(), init(), Wireless::isConnected(), Wireless::isError(), Wireless::listen(), Wireless::ListenCont(), Wireless::ReceiveCont(), Wireless::SendCont(), setFlushType(), vprintf(), and write().
if true, when data is sent to the socket and the socket is not current connected, the data will be sent to stdout (overridden by forwardSock)
Definition at line 265 of file Socket.h. Referenced by getWriteBuffer(), setForward(), setTextForward(), vprintf(), and write().
temporary buffer allocated in getWriteBuffer() and freed in write(), if the output is destined for stdout (textForward)
Definition at line 266 of file Socket.h. Referenced by getWriteBuffer(), and write().
stores choice between transports (UDP or TCP (aka Datagram or Stream))
Definition at line 225 of file Socket.h. Referenced by getTransport(), init(), and setTransport().
a flag set when sendData is in the process of being sent to the system
Definition at line 248 of file Socket.h. Referenced by Wireless::blockingSend(), flush(), Wireless::isReady(), Wireless::send(), and Wireless::SendCont().
can be used to filter calls to pprintf
Definition at line 228 of file Socket.h. Referenced by pprintf(), and setVerbosity().
a region within sendBuffer, holds data still being filled in by user code, not yet flushed
Definition at line 253 of file Socket.h. Referenced by flush(), getWriteBuffer(), Wireless::socket(), and vprintf().
the size of writeData (amount of data so far ready to be flushed)
Definition at line 246 of file Socket.h. Referenced by flush(), getAvailableSendSize(), getWriteBuffer(), init(), vprintf(), and write().
The documentation for this class was generated from the following files: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Tekkotsu v3.0 |
Generated Wed Oct 4 00:05:14 2006 by Doxygen 1.4.7 |