MCPcopy Create free account
hub / github.com/RangeNetworks/openbts / sendServiceLoop

Function sendServiceLoop

GPRS/BSSG.cpp:209–230  ·  view source on GitHub ↗

OLD: Send this loop an NS_BLOCK message to kill this thread off; and we dont normally use that NS message. There is a BSSG-level BVC_BLOCK message that we would use to do a temporary data block.

Source from the content-addressed store, hash-verified

207// and we dont normally use that NS message.
208// There is a BSSG-level BVC_BLOCK message that we would use to do a temporary data block.
209void *sendServiceLoop(void *arg)
210{
211 BSSGMain *bssgp = (BSSGMain*)arg;
212 NSPDUType::type nstype = NSPDUType::NS_RESET; // init to anything.
213 do {
214 NSMsg *ulmsg = bssgp->mbsTxQ.read();
215 // It is already wrapped up in an NS protocol.
216 int msgsize = ulmsg->size();
217 ssize_t result = send(bssgp->mbsSGSockfd,ulmsg->begin(),msgsize,0);
218 nstype = ulmsg->getNSPDUType();
219 int debug_level = 1; //(nstype == NSPDUType::NS_UNITDATA) ? 1 : 4;
220 if (GPRS::GPRSDebug & debug_level) {
221 GPRSLOG(debug_level) << "BSSG ===> sendServiceLoop sent "
222 <<nstype<<LOGVAR(msgsize)<<ulmsg->str()<<timestr();
223 }
224 if (result != msgsize) {
225 LOG(ERR) << "BSSGP invalid send result" << LOGVAR(result) << LOGVAR(msgsize);
226 }
227 delete ulmsg;
228 } while (bssgp->mbsIsOpen /*&& nstype != NSPDUType::NS_BLOCK*/);
229 return NULL;
230}
231
232static int opensock(uint32_t sgsnIp, int sgsnPort /*,int bssgPort*/ )
233{

Callers

nothing calls this directly

Calls 5

getNSPDUTypeMethod · 0.80
readMethod · 0.45
sizeMethod · 0.45
beginMethod · 0.45
strMethod · 0.45

Tested by

no test coverage detected