::Ice::DispatchStatus Communication::DataInterface::___sendByteData(::IceInternal::Incoming& __inS, const ::Ice::Current& __current) { __checkMode(::Ice::Idempotent, __current.mode); ::IceInternal::BasicStream* __is = __inS.is(); __is->startReadEncaps(); ::Communication::ByteDataPtr data; __is->read(::Communication::__patch__ByteDataPtr, &data); __is->readPendingObjects(); __is->endReadEncaps(); sendByteData(data, __current); return ::Ice::DispatchOK; }
//sends the specified string to the socket as \n terminated //sequence of chars. // //return > 0 => everything ok // < 0 => error occured connection closed int sendString(SOCKET socket, string text) { int success = 1; char* cstr = new char[text.size() + 1]; strcpy(cstr, text.c_str()); cstr[text.size()] = '\n'; int iResult = sendByteData(socket, cstr, text.size() + 1); if (iResult <= 0) { success = iResult; } delete cstr; return success; }