本文整理汇总了C++中EthernetClient::GetSocket方法的典型用法代码示例。如果您正苦于以下问题:C++ EthernetClient::GetSocket方法的具体用法?C++ EthernetClient::GetSocket怎么用?C++ EthernetClient::GetSocket使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类EthernetClient
的用法示例。
在下文中一共展示了EthernetClient::GetSocket方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ProcessWebClients
void web::ProcessWebClients()
{
// listen for incoming clients
EthernetClient client = m_server->available();
if (client)
{
bool bReset = false;
#ifdef ARDUINO
FILE stream_file;
FILE * pFile = &stream_file;
setup_sendbuf();
fdev_setup_stream(pFile, stream_putchar, NULL, _FDEV_SETUP_WRITE);
stream_file.udata = &client;
#else
FILE * pFile = fdopen(client.GetSocket(), "w");
#endif
freeMemory();
trace(F("Got a client\n"));
//ShowSockStatus();
KVPairs key_value_pairs;
char sPage[35];
if (!ParseHTTPHeader(client, &key_value_pairs, sPage, sizeof(sPage)))
{
trace(F("ERROR!\n"));
ServeError(pFile);
}
else
{
trace(F("Page:%s\n"), sPage);
//ShowSockStatus();
if (strcmp(sPage, "bin/setSched") == 0)
{
if (SetSchedule(key_value_pairs))
{
if (GetRunSchedules())
ReloadEvents();
ServeHeader(pFile, 200, "OK", false);
}
else
ServeError(pFile);
}
else if (strcmp(sPage, "bin/setZones") == 0)
{
if (SetZones(key_value_pairs))
{
ReloadEvents();
ServeHeader(pFile, 200, "OK", false);
}
else
ServeError(pFile);
}
else if (strcmp(sPage, "bin/delSched") == 0)
{
if (DeleteSchedule(key_value_pairs))
{
if (GetRunSchedules())
ReloadEvents();
ServeHeader(pFile, 200, "OK", false);
}
else
ServeError(pFile);
}
else if (strcmp(sPage, "bin/setQSched") == 0)
{
if (SetQSched(key_value_pairs))
{
ServeHeader(pFile, 200, "OK", false);
}
else
ServeError(pFile);
}
else if (strcmp(sPage, "bin/settings") == 0)
{
if (SetSettings(key_value_pairs))
{
ReloadEvents();
ServeHeader(pFile, 200, "OK", false);
}
else
ServeError(pFile);
}
else if (strcmp(sPage, "bin/manual") == 0)
{
if (ManualZone(key_value_pairs))
{
ServeHeader(pFile, 200, "OK", false);
}
else
ServeError(pFile);
}
else if (strcmp(sPage, "bin/run") == 0)
{
if (RunSchedules(key_value_pairs))
{
ReloadEvents();
ServeHeader(pFile, 200, "OK", false);
}
//.........这里部分代码省略.........