示例#1
0
int MSRawConnection::syncSend(const MSString &aString_,int seconds,int microseconds,MSBoolean isAbsolute)
{

  if (isSet(MSProtocolConnection<MSString>::Reset)) return 0;
  struct timeval timeout, now, tvp;
  if (isAbsolute==MSTrue)
   {
     if (0 > microseconds) return 0;
     tvp.tv_sec=seconds;
     tvp.tv_usec=microseconds;
   }
  else
   {
     gettimeofday(&now,NULL);
     timeout.tv_sec=seconds;
     timeout.tv_usec=microseconds;
     tvsum(&now,&timeout,&tvp);
   }
  if(writeChannel()==0)
   {
     MSMessageLog::errorMessage("MSRawConnection::syncSend: No Write Channel\n");
     return 0;
   }
  MSBuffer *b=new MSBuffer;
  if (b==NULL) return 0;
  b->stuff(aString_.string(),aString_.length());
  sendTheBuffer(b);
  return syncWriteSelectLoop(&tvp);
}
示例#2
0
int MSRawConnection::send(const MSString& aString_)
{
  if (isSet(MSProtocolConnection<MSString>::Reset)==MSTrue) return MSFalse;
  if (readChannel()==0) return MSFalse; 

  MSBuffer *pBuffer=new MSBuffer;
  pBuffer->stuff(aString_.string(),aString_.length());
  sendTheBuffer(pBuffer);
  if (isSet(MSProtocolConnection<MSString>::WritePause)==MSFalse) writeChannel()->enable();
  // attempt to immediately write the buffer
  return doWrite(MSFalse);
}
示例#3
0
MSMBSDate::MSMBSDate(const MSString& aString_,const char* strptimeFormat_)
: MSDate(MSJulian(0))
{
  struct tm aTimeStruct={0};
#if defined(MS_NO_STRPTIME)
  MSMessageLog::errorMessage("MSMBSDate: strptime() not supported for this platform.\n");
  _date=0;
#else
  char *pString=strptime((char *)aString_.string(),(char *)strptimeFormat_,&aTimeStruct);
  if (pString==0) _date=0;
  else _date=as30_360(aTimeStruct.tm_mon+1,aTimeStruct.tm_mday,aTimeStruct.tm_year+1900);
#endif
}
示例#4
0
MSError::ErrorStatus MSMBSDate::set(const MSString& aString_) { return set(aString_.string()); }
示例#5
0
文件: MSTerm.C 项目: PlanetAPL/a-plus
MSError::ErrorStatus MSTerm::set(const MSString& sp_)
{ return set(sp_.string()); }