This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

cc3200云服务器通讯问题

Other Parts Discussed in Thread: CC3200

我采用UDP的通讯方式和云服务器连接,CC3200发送数据包到服务器是正常的,但是服务器接收后发回给CC3200的心跳包数据接收不到,通过调试,发现CC3200每次发送给服务器的端口是变化的,可能是这个原因导致服务器发回来CC3200无法接收到,通过绑定端口设置为80端口号,服务器那边接收到的端口还是每次不同,我是参考CC3000的方法配置链接的,请问是什么原因CC3200每次发送的数据包在服务器看到的端口总是不一样的?

//绑定端口号
void Set_Port(unsigned short Port)
{
// sockaddr tSocketAddr;
// SlSockAddrIn_t sLocalAddr;
sockaddr tSocketAddr;
int iStatus;


tSocketAddr.sa_family = AF_INET;

// the source port
tSocketAddr.sa_data[0] = MSB(Port);
tSocketAddr.sa_data[1] = LSB(Port);

// all 0 IP address
memset (&tSocketAddr.sa_data[2], 0, 4);

bind(ulSocket, &tSocketAddr, sizeof(sockaddr));