Skip to content

Commit

Permalink
修复windows下编译错误
Browse files Browse the repository at this point in the history
  • Loading branch information
HEYAHONG committed Sep 21, 2024
1 parent 02f363d commit 6b98ddf
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions test/ModbusTCPServerTiny/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ static void server_thread()
while(is_running)
{
uint8_t packet[MODBUS_TCP_MAX_ADU_LENGTH*2];//缓冲稍大于实际需要
int recvlen=recv(connection_fd,packet,sizeof(packet),0);
int recvlen=recv(connection_fd,(char *)packet,sizeof(packet),0);
if(recvlen>0)
{
//接收到正确的数据
Expand All @@ -80,7 +80,7 @@ static void server_thread()
size_t offset=0;
do
{
int sendlen=send(connection_fd,adu+offset,adu_length-offset,0);
int sendlen=send(connection_fd,(const char *)(adu+offset),adu_length-offset,0);
if(sendlen>0)
{
offset+=sendlen;
Expand Down

0 comments on commit 6b98ddf

Please sign in to comment.