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 72 of file Socket.h.
Member Typedef Documentation
Member Enumeration Documentation
Chooses between blocking and non-blocking Wireless Input, Output. Blocking wireless output from the main process will affect the performance of the Aibo, and should only be used for debugging purposes.
Constructor & Destructor Documentation
copy constructor, don't call
Member Function Documentation
use getWriteBuffer to get a memory address to write bytes to, for subsequent writing to a connection. 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(), EventLogger::dumpNode(), getWriteBuffer(), 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().
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(), EventLogger::dumpNode(), Controller::loadGUI(), EventRouter::processData(), WorldStateSerializerBehavior::processEvent(), RemoteRouter::processEvent(), MicrophoneServer::processEvent(), EventLogger::processEvent(), ControlBase::refresh(), BatteryCheckControl::refresh(), WMMonitorBehavior::report(), DumpFileControl::selectedFile(), NetworkBuffer::send(), SegCamBehavior::sendCloseConnectionPacket(), RawCamBehavior::sendCloseConnectionPacket(), CameraStreamBehavior::sendSensors(), LGmixin::uploadCameraImage(), LGmixin::uploadFile(), and write().
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.
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.
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 setTransport().
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.
returns the transport in use
Definition at line 174 of file Socket.h. Referenced by SegCamBehavior::processEvent(), RegionCamBehavior::processEvent(), and RawCamBehavior::processEvent().
causes this socket to forward output to stdout if it is not connected, call setForward(NULL) to unset
Reimplemented in DummySocket.
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.
Standard write - writes specified amount of data from a buffer to a connection You might want to consider the getWriteBuffer-write(int) combo if you call this often
Reimplemented in DummySocket.
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.
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(), EmergencyStopMC::EmergencyStopMC(), WalkCalibration::err(), FreeMemReportControl::freeMem(), PNGGenerator::getBinSize(), JPEGGenerator::getBinSize(), Kinematics::getInterestPoint(), EventLogger::indent(), Kinematics::initStatics(), ControlBase::invalidInput(), PostureMC::isAlive(), StewartPlatformBehavior::isConnected(), WalkMC::loadBuffer(), SegmentedColorGenerator::loadBuffer(), RLEGenerator::loadBuffer(), RegionGenerator::loadBuffer(), RawCameraGenerator::loadBuffer(), PNGGenerator::loadBuffer(), JPEGGenerator::loadBuffer(), InterleavedYUVGenerator::loadBuffer(), CDTGenerator::loadBuffer(), BufferedImageGenerator::loadBuffer(), SegmentedColorGenerator::loadColorInfo(), WalkCalibration::loadData(), SegmentedColorGenerator::loadThresholdMap(), Kinematics::lookup(), Kinematics::newChain(), MotionSequenceMC< MAXMOVE >::newKeyFrame(), ProjectInterface::noSendCommandErr(), Controller::pop(), pprintf(), EchoBehavior::processCallback(), WalkCalibration::processEvent(), ValueEditControl< T >::processEvent(), SensorObserverControl::processEvent(), SegCamBehavior::processEvent(), RegionGenerator::processEvent(), RawCameraGenerator::processEvent(), RawCamBehavior::processEvent(), PostureEditor::processEvent(), FreeMemReportControl::processEvent(), FilterBankGenerator::processEvent(), EventLogger::processEvent(), EStopControllerBehavior::processEvent(), EchoBehavior::processEvent(), CDTGenerator::processEvent(), BufferedImageGenerator::processEvent(), BallDetectionGenerator::processEvent(), EventLogger::processStateMachineEvent(), Controller::push(), LoadCalibration::readData(), LoadCalibration::readMaxs(), CameraStreamBehavior::receiveData(), TorqueCalibrate::record(), WaypointWalkControl::refresh(), WalkCalibration::refresh(), ValueEditControl< T >::refresh(), TorqueCalibrate::refresh(), NetworkStatusControl::refresh(), FilterBankGenerator::refresh(), ControlBase::refresh(), ConfigurationEditor::NamedEnumerationEditor::refresh(), RegionGenerator::RegionGenerator(), WMMonitorBehavior::registerData(), WMMonitorBehavior::report(), WalkCalibration::report(), HelpControl::report(), FreeMemReportControl::report(), BatteryCheckControl::report(), EventLogger::runCommand(), EStopControllerBehavior::runCommand(), SegmentedColorGenerator::saveBuffer(), RLEGenerator::saveBuffer(), RegionGenerator::saveBuffer(), RawCameraGenerator::saveBuffer(), PNGGenerator::saveBuffer(), JPEGGenerator::saveBuffer(), InterleavedYUVGenerator::saveBuffer(), CDTGenerator::saveBuffer(), BufferedImageGenerator::saveBuffer(), WalkCalibration::saveData(), RawCameraGenerator::saveFileStream(), BufferedImageGenerator::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(), BatteryMonitorBehavior::startWarning(), BatteryMonitorBehavior::stopWarning(), SaveWalkControl::takeInput(), ControlBase::takeInput(), Controller::takeLine(), EmergencyStopMC::trigger(), LGmixin::uploadCameraImage(), LGmixin::uploadFile(), write(), and StateNode::~StateNode().
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().
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.
Initiate blocking or nonblocking write transfer depending on the type of socket. 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.
returns the address of the remote host in local host byte order
Definition at line 238 of file Socket.h. Referenced by EventRouter::processData(), and RemoteEvents::remoteIPInt().
Friends And Related Function Documentation
Member Data Documentation
unique non-negative integer representing socket. Serves as index into socket Objects array
Definition at line 76 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(), SpeakerServer::DoStart(), MicrophoneServer::DoStart(), HeadPointControllerBehavior::DoStart(), EStopControllerBehavior::DoStart(), Controller::DoStart(), flush(), Wireless::getDaemon(), RemoteEvents::isConnected(), Wireless::listen(), EventLogger::logImage(), EventLogger::logMessage(), EventLogger::logWebcam(), WorldStateSerializerBehavior::processEvent(), SegCamBehavior::processEvent(), RegionCamBehavior::processEvent(), RawCamBehavior::processEvent(), MicrophoneServer::processEvent(), EventLogger::processEvent(), EchoBehavior::processEvent(), ConnectionMadeTrans::processEvent(), EventLogger::processStateMachineEvent(), WalkCalibration::refresh(), ValueEditControl< T >::refresh(), ControlBase::refresh(), ConfigurationEditor::NamedEnumerationEditor::refresh(), BatteryCheckControl::refresh(), Wireless::setDaemon(), Wireless::setReceiver(), EchoBehavior::setupNetwork(), LGmixin::uploadFile(), and LGmixin::~LGmixin().
stores choice between transports (UDP or TCP (aka Datagram or Stream))
Definition at line 243 of file Socket.h. Referenced by getTransport(), init(), and setTransport().
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 244 of file Socket.h. Referenced by flush(), getFlushType(), and setFlushType().
can be used to filter calls to pprintf
Definition at line 246 of file Socket.h. Referenced by pprintf(), and setVerbosity().
an enum representing the current state of the socket
Definition at line 257 of file Socket.h. Referenced by flush(), getWriteBuffer(), init(), Wireless::isConnected(), Wireless::isError(), setFlushType(), vprintf(), and write().
the size of the buffer for sendData and writeData
Definition at line 259 of file Socket.h. Referenced by getAvailableSendSize(), getMaxSendSize(), getWriteBuffer(), and vprintf().
the size of the buffer for readData and recvData
Definition at line 260 of file Socket.h. Referenced by getAvailableReceiveSize(), and getMaxReceiveSize().
the size of writeData (amount of data so far ready to be flushed)
Definition at line 264 of file Socket.h. Referenced by flush(), getAvailableSendSize(), getWriteBuffer(), init(), vprintf(), and write().
a flag set when sendData is in the process of being sent to the system
Definition at line 266 of file Socket.h. Referenced by flush(), and Wireless::isReady().
a region within sendBuffer, holding data in the process of being sent
Definition at line 270 of file Socket.h. Referenced by flush().
a region within sendBuffer, holds data still being filled in by user code, not yet flushed
Definition at line 271 of file Socket.h. Referenced by flush(), getWriteBuffer(), and vprintf().
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)
pointer to callback function, called after recvData has been filled in
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 280 of file Socket.h. Referenced by getPeerAddress(), getPeerAddressAsString(), and init().
port of peer (if connected) or last message sender (if udp and bound); -1 otherwise
Definition at line 281 of file Socket.h. Referenced by getPeerPort(), and init().
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 283 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 284 of file Socket.h. Referenced by getWriteBuffer(), and write().
if non-NULL, output will be sent to this socket if the current socket is not otherwise connected (overrides textForward)
Definition at line 285 of file Socket.h. Referenced by flush(), getWriteBuffer(), setForward(), setTextForward(), vprintf(), and write().
if true, the socket will automatically be reopened after any closure (manual or otherwise)
Definition at line 287 of file Socket.h. Referenced by Wireless::getDaemon(), getDaemon(), and Wireless::setDaemon().
The documentation for this class was generated from the following files: |
Tekkotsu v4.0 |
Generated Thu Nov 22 00:58:42 2007 by Doxygen 1.5.4 |