资源简介

一端串口写入数据,另一端串口读取数据分离后,通过tcp发送数据

资源截图

代码片段和文件信息

#include “stdafx.h“
#include “Client_Socket.h“

CClient::CClient()
{
m_hSocket =NULL;
memset(&m_Srvaddr0sizeof(m_Srvaddr));
}

CClient::~CClient()
{
if(m_hSocket!=NULL)
{
closesocket(m_hSocket);
WSACleanup();
}
}

void CClient::ClientInit()
{
WORD wVersionRequested;
WSADATA wsaData;
int err;
wVersionRequested=MAKEWORD(11);
err=WSAStartup(wVersionRequested&wsaData);
if (err!=0)
{
std::cout<<“Error in Init!“< return;
}
if(LOBYTE(wsaData.wVersion)!=1|| HIBYTE(wsaData.wVersion)!=1)
{
WSACleanup();
std::cout<<“Error in Init!“< return;
}
}

BOOL CClient::InitAndConnet(UINT portCString strserver)
{
m_uPort=port;
m_strServer=strserver;
if(m_hSocket != NULL)
{
//如果原来打开这套接字先关闭
closesocket(m_

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件          1  2006-11-20 00:11  Comm_Socket\RS232TCP(Async--Winsock)Read\RS232TCP\ClassDiagram1.cd

     文件          1  2006-11-20 00:11  Comm_Socket\RS232TCP(Async--Winsock)Read\RS232TCP\ClassDiagram11.cd

     文件       1993  2009-07-04 17:16  Comm_Socket\RS232TCP(Async--Winsock)Read\RS232TCP\Client_Socket.cpp

     文件        438  2009-07-04 16:33  Comm_Socket\RS232TCP(Async--Winsock)Read\RS232TCP\Client_Socket.h

     文件       1840  2009-06-11 08:44  Comm_Socket\RS232TCP(Async--Winsock)Read\RS232TCP\ReadMe.txt

     文件        406  2009-06-11 08:44  Comm_Socket\RS232TCP(Async--Winsock)Read\RS232TCP\Resource.h

     文件      18327  2009-07-06 08:56  Comm_Socket\RS232TCP(Async--Winsock)Read\RS232TCP\RS232.cpp

     文件       1111  2009-07-06 08:55  Comm_Socket\RS232TCP(Async--Winsock)Read\RS232TCP\RS232.h

     文件      17964  2009-06-23 09:26  Comm_Socket\RS232TCP(Async--Winsock)Read\RS232TCP\RS232TCP.APS

     文件       2315  2009-07-04 16:35  Comm_Socket\RS232TCP(Async--Winsock)Read\RS232TCP\RS232TCP.cpp

     文件         39  2009-06-11 08:44  Comm_Socket\RS232TCP(Async--Winsock)Read\RS232TCP\RS232TCP.h

     文件       1404  2009-06-11 08:44  Comm_Socket\RS232TCP(Async--Winsock)Read\RS232TCP\RS232TCP.rc

     文件       5262  2009-07-06 08:48  Comm_Socket\RS232TCP(Async--Winsock)Read\RS232TCP\RS232TCP.vcproj

     文件       1411  2009-06-16 17:37  Comm_Socket\RS232TCP(Async--Winsock)Read\RS232TCP\RS232TCP.vcproj.BAIYONG.hntw2000.user

     文件       1417  2009-07-01 17:19  Comm_Socket\RS232TCP(Async--Winsock)Read\RS232TCP\RS232TCP.vcproj.CCF-WS-103.ccf.user

     文件       1427  2009-07-06 16:12  Comm_Socket\RS232TCP(Async--Winsock)Read\RS232TCP\RS232TCP.vcproj.HNU-DD72B6CF2C7.prg.user

     文件       1427  2009-06-17 17:48  Comm_Socket\RS232TCP(Async--Winsock)Read\RS232TCP\RS232TCP.vcproj.WWW-7ED633BC145.Administrator.user

     文件       3548  2009-07-03 12:17  Comm_Socket\RS232TCP(Async--Winsock)Read\RS232TCP\Server_Socket.cpp

     文件        556  2009-06-24 09:52  Comm_Socket\RS232TCP(Async--Winsock)Read\RS232TCP\Server_Socket.h

     文件        295  2009-06-11 08:44  Comm_Socket\RS232TCP(Async--Winsock)Read\RS232TCP\stdafx.cpp

     文件        960  2009-06-11 08:44  Comm_Socket\RS232TCP(Async--Winsock)Read\RS232TCP\stdafx.h

     文件       1074  2009-07-04 16:28  Comm_Socket\RS232TCP(Async--Winsock)Read\RS232TCP\StructNode.cpp

     文件        369  2009-07-04 16:27  Comm_Socket\RS232TCP(Async--Winsock)Read\RS232TCP\StructNode.h

     文件       1428  2009-06-11 08:44  Comm_Socket\RS232TCP(Async--Winsock)Read\RS232TCP\targetver.h

     文件        944  2009-06-16 08:57  Comm_Socket\RS232TCP(Async--Winsock)Read\RS232TCP\TCP_Client.cpp

     文件        318  2009-06-16 08:35  Comm_Socket\RS232TCP(Async--Winsock)Read\RS232TCP\TCP_Client.h

     文件        890  2009-06-11 08:45  Comm_Socket\RS232TCP(Async--Winsock)Read\RS232TCP.sln

    ..A..H.     79360  2009-07-06 16:12  Comm_Socket\RS232TCP(Async--Winsock)Read\RS232TCP.suo

     文件       1762  2009-06-16 16:45  Comm_Socket\RS232TCP(Async--Winsock)Read\WaitCommEvent.txt

     文件          1  2006-11-20 00:11  Comm_Socket\RS232TCP(Async--Winsock)Write\RS232TCP\ClassDiagram1.cd

............此处省略36个文件信息

评论

共有 条评论

相关资源