当前位置: 首页>>代码示例>>C++>>正文


C++ Display::Exeception方法代码示例

本文整理汇总了C++中Display::Exeception方法的典型用法代码示例。如果您正苦于以下问题:C++ Display::Exeception方法的具体用法?C++ Display::Exeception怎么用?C++ Display::Exeception使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Display的用法示例。


在下文中一共展示了Display::Exeception方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: main

int main(int argc, char *argv[])
{
	Display *disp = new Display();
  title("Server", '=');
  try
  {
	  string client_port;
	  if (argc > 1)
	  {
		  client_port = argv[1];
	  }
	int clientport=atoi(client_port.c_str());
    Verbose v(true);
    SocketSystem ss;
    SocketListener sl(clientport,Socket::IP6);
    ClientHandler cp;
    sl.start(cp);
    Verbose::show("press key to exit: ", always);
    std::cout.flush();
    std::cin.get();
  }
  catch (std::exception& ex)
  {
	  disp->Exeception(ex);
  }
}
开发者ID:sdontire,项目名称:Remote-Code-Management-Facility,代码行数:26,代码来源:ServerTest.cpp

示例2: writeToFile

// Writes to the file in the server..
string Receiver::writeToFile(std::string filemsg, bool type,Socket &si)
{
	Display *disp = new Display();
	Message *m = new Message();
	char filestart = m->getFileStart(filemsg);
	string filename = m->getFileName(filemsg),fullpath= "../UploadedFolder/" + filename,msgbody = m->getmsgBody(filemsg),msgstr="";
	std::ofstream o;
	try
	{
		if (type == true)
		{
			if (filestart == '1')
			{
				o.open(fullpath);
				o << msgbody << endl;
			}
			else if (filemsg.find("Body:endfile") != string::npos)
			{
				o.close();
				string uploadpath = "../UploadedFolder/" + m->getFileName(filemsg);
				disp->show("\n**************************************************\n");
				disp->show("Requirement 1\n");
				string uploadstring = "Recieved File: " + m->getFileName(filemsg)+" And stored at path: " +uploadpath;
				disp->show(uploadstring);
				string pmsg = "Sending Acknowledgement to Client with address: " + m->getsendAddr(filemsg);
				disp->show(pmsg);
				disp->show("\n**************************************************\n");
				msgstr = setMessage(filemsg);
			}
			else
			{
				o.open(fullpath,ios::app);
				if (o.is_open())
					o << msgbody << endl;
			}

		}
		return msgstr;
	}
	catch (exception ex)
	{
		disp->Exeception(ex);
		return "";
	}
}
开发者ID:sdontire,项目名称:Remote-Code-Management-Facility,代码行数:46,代码来源:Receiver.cpp

示例3: start

// Starts the receiver
string Receiver::start(string msg1,Socket &si)
{
	try
		{
			    Message *msgobj = new Message();
				msgobj->setMessage(msg1);
				string msgstr="";
				if (msg1.find("command:uploadfile") != std::string::npos)
					msgstr=writeToFile(msg1, type,si);
				if (msg1.find("command:download") != std::string::npos)
					msgstr=downloadMessage(msg1, msgobj,si);
				else if (msg1.find("command:filesearch") != std::string::npos)
					msgstr = filesearchMessage(msg1, msgobj, si);
				else if (msg1.find("command:textsearch") != std::string::npos)
				{
					string result = "";
					result = performTextSearch(msg1, result);
					msgstr = result;
					//si.sendString(result);
				}
				else if (msg1.find("command:retrieve_categories") != std::string::npos)
				{
					string result = "";
					result=performRetrieveCategories(msg1,result);
					msgstr = result;
					//si.sendString(result);
				}
				else if (msg1.find("command:retrieve_files") != std::string::npos)
				{
					string result = "";
					result = performRetrieveFiles(msg1, result);
					msgstr = result;
					//si.sendString(result);
				}
				return msgstr;
		}

		catch (std::exception& ex)
		{
			Display *disp = new Display();
			disp->Exeception(ex);
			return "";
		}
		
}
开发者ID:sdontire,项目名称:Remote-Code-Management-Facility,代码行数:46,代码来源:Receiver.cpp


注:本文中的Display::Exeception方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。