91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

  • 大小: 5.82MB
    文件類型: .rar
    金幣: 2
    下載: 0 次
    發(fā)布日期: 2023-11-02
  • 語言: C/C++
  • 標簽: windows7??modbustcp??server??

資源簡介

親測在windows7下可用

資源截圖

代碼片段和文件信息

#include?
#ifndef?_MSC_VER
#include?
#endif
#include?
#include?

#include?“modbus.h“

int?main(void)
{
????int?server_socket?=?-1;
modbus_t*?ctx;
modbus_mapping_t*?mb_mapping;

ctx?=?modbus_new_tcp(NULL?1502);
modbus_set_debug(ctx?TRUE);


mb_mapping?=?modbus_mapping_new(500?500?500?500);
if(mb_mapping?==?NULL)
{
????fprintf(stderr?“Failed?mapping:%s\n“?modbus_strerror(errno));
modbus_free(ctx);
return?-1;
}


server_socket?=?modbus_tcp_listen(ctx?1);
if(server_socket==-1)
{
????fprintf(stderr?“Unable?to?listen?TCP\n“);
modbus_free(ctx);
return?-1;
}


modbus_tcp_accept(ctx?&server_socket);

for(;;)
{
????uint8_t?query[MODBUS_TCP_MAX_ADU_LENGTH];
int?rc;

rc?=?modbus_receive(ctx?query);
if(rc>1)
{

????????modbus_reply(ctx?query?rc?mb_mapping);
}
else
{
????
printf(“Connection?Closed\n“);

modbus_close(ctx);

modbus_tcp_accept(ctx?&server_socket);
}
}

printf(“Quit?the?loop:%s\n“?modbus_strerror(errno));

modbus_mapping_free(mb_mapping);
modbus_close(ctx);
modbus_free(ctx);

return?0;
}

?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----

?????文件??????30720??2017-06-29?20:34??TestTcpServer\TestTcpServer\Debug\TestTcpServer.exe

?????文件?????351452??2017-06-29?20:34??TestTcpServer\TestTcpServer\Debug\TestTcpServer.ilk

?????文件?????445440??2017-06-29?20:34??TestTcpServer\TestTcpServer\Debug\TestTcpServer.pdb

?????文件????1441792??2017-06-29?20:14??TestTcpServer\TestTcpServer\ipch\testtcpserver-6c2ab4a6\testtcpserver-b582194a.ipch

?????文件????????730??2017-06-29?20:34??TestTcpServer\TestTcpServer\TestTcpServer\Debug\cl.command.1.tlog

?????文件??????15370??2017-06-29?20:34??TestTcpServer\TestTcpServer\TestTcpServer\Debug\CL.read.1.tlog

?????文件????????438??2017-06-29?20:34??TestTcpServer\TestTcpServer\TestTcpServer\Debug\CL.write.1.tlog

?????文件??????????2??2017-06-29?20:34??TestTcpServer\TestTcpServer\TestTcpServer\Debug\link-cvtres.read.1.tlog

?????文件??????????2??2017-06-29?20:34??TestTcpServer\TestTcpServer\TestTcpServer\Debug\link-cvtres.write.1.tlog

?????文件??????????2??2017-06-29?20:34??TestTcpServer\TestTcpServer\TestTcpServer\Debug\link.1300-cvtres.read.1.tlog

?????文件??????????2??2017-06-29?20:34??TestTcpServer\TestTcpServer\TestTcpServer\Debug\link.1300-cvtres.write.1.tlog

?????文件??????????2??2017-06-29?20:34??TestTcpServer\TestTcpServer\TestTcpServer\Debug\link.1300.read.1.tlog

?????文件??????????2??2017-06-29?20:34??TestTcpServer\TestTcpServer\TestTcpServer\Debug\link.1300.write.1.tlog

?????文件???????1806??2017-06-29?20:34??TestTcpServer\TestTcpServer\TestTcpServer\Debug\link.command.1.tlog

?????文件???????3918??2017-06-29?20:34??TestTcpServer\TestTcpServer\TestTcpServer\Debug\link.read.1.tlog

?????文件???????1050??2017-06-29?20:34??TestTcpServer\TestTcpServer\TestTcpServer\Debug\link.write.1.tlog

?????文件????????442??2017-06-29?20:34??TestTcpServer\TestTcpServer\TestTcpServer\Debug\mt.command.1.tlog

?????文件????????386??2017-06-29?20:34??TestTcpServer\TestTcpServer\TestTcpServer\Debug\mt.read.1.tlog

?????文件????????386??2017-06-29?20:34??TestTcpServer\TestTcpServer\TestTcpServer\Debug\mt.write.1.tlog

?????文件????????632??2017-06-29?20:34??TestTcpServer\TestTcpServer\TestTcpServer\Debug\rc.command.1.tlog

?????文件????????358??2017-06-29?20:34??TestTcpServer\TestTcpServer\TestTcpServer\Debug\rc.read.1.tlog

?????文件????????366??2017-06-29?20:34??TestTcpServer\TestTcpServer\TestTcpServer\Debug\rc.write.1.tlog

?????文件????????561??2017-06-29?20:34??TestTcpServer\TestTcpServer\TestTcpServer\Debug\TestTcpServer.Build.CppClean.log

?????文件????????406??2017-06-29?20:34??TestTcpServer\TestTcpServer\TestTcpServer\Debug\TestTcpServer.exe.embed.manifest

?????文件????????472??2017-06-29?20:34??TestTcpServer\TestTcpServer\TestTcpServer\Debug\TestTcpServer.exe.embed.manifest.res

?????文件????????381??2017-06-29?20:34??TestTcpServer\TestTcpServer\TestTcpServer\Debug\TestTcpServer.exe.intermediate.manifest

?????文件?????????71??2017-06-29?20:34??TestTcpServer\TestTcpServer\TestTcpServer\Debug\TestTcpServer.lastbuildstate

?????文件???????3253??2017-06-29?20:34??TestTcpServer\TestTcpServer\TestTcpServer\Debug\TestTcpServer.log

?????文件??????28317??2017-06-29?20:34??TestTcpServer\TestTcpServer\TestTcpServer\Debug\TestTcpServer.obj

?????文件??????????0??2017-06-29?20:34??TestTcpServer\TestTcpServer\TestTcpServer\Debug\TestTcpServer.write.1.tlog

............此處省略26個文件信息

評論

共有 條評論