本文整理汇总了C++中TcpSocket::tcpSend方法的典型用法代码示例。如果您正苦于以下问题:C++ TcpSocket::tcpSend方法的具体用法?C++ TcpSocket::tcpSend怎么用?C++ TcpSocket::tcpSend使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TcpSocket
的用法示例。
在下文中一共展示了TcpSocket::tcpSend方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: reproACK
int reproACK(TcpSocket &r_tcp, int result){
cout<<"reprogram send ack"<<endl;
char send_buf[20];
bzero(send_buf, sizeof(send_buf));
switch (result){
case 0:
sprintf(send_buf, "%s", "0,success");
cout<<send_buf<<endl;
r_tcp.tcpSend(send_buf, strlen(send_buf));
break;
case 1:
sprintf(send_buf, "%s", "1,failed");
cout<<send_buf<<endl;
r_tcp.tcpSend(send_buf,strlen(send_buf));
break;
case 2:
sprintf(send_buf, "%s", "2,failed");
cout<<send_buf<<endl;
r_tcp.tcpSend(send_buf,strlen(send_buf));
break;
case 3:
sprintf(send_buf, "%s", "3,failed");
cout<<send_buf<<endl;
r_tcp.tcpSend(send_buf,strlen(send_buf));
break;
case 4:
sprintf(send_buf, "%s", "4,failed");
cout<<send_buf<<endl;
r_tcp.tcpSend(send_buf,strlen(send_buf));
break;
case 5:
sprintf(send_buf, "%s", "5,failed");
cout<<send_buf<<endl;
r_tcp.tcpSend(send_buf,strlen(send_buf));
break;
case 6:
sprintf(send_buf, "%s", "6,failed");
cout<<send_buf<<endl;
r_tcp.tcpSend(send_buf,strlen(send_buf));
break;
case 7:
sprintf(send_buf, "%s", "7,failed");
cout<<send_buf<<endl;
r_tcp.tcpSend(send_buf, strlen(send_buf));
break;
default:
break;
}
}