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.
| 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. |
| 209 | void *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 | |
| 232 | static int opensock(uint32_t sgsnIp, int sgsnPort /*,int bssgPort*/ ) |
| 233 | { |
nothing calls this directly
no test coverage detected