TTcpClient和TTcpServer通信问题
在确认Server端Accept成功 和Client connect成功之后
我想实现:Client 发送数据,Server接收,不知道为什么总是不成功,代码如下:
Server端:
char buffer[100]="";
TMemoryStream *mystream = new TMemoryStream();
while(1)
{
int n=this->TcpServer1->ReceiveBuf(buffer,99,0);//&& buffer[0]=='j'
if(n>0 )
{
ShowMessage(n) ;
}
}
char buffer[100]="weishenme";
while(1)
{
TMemoryStream *mystream=new TMemoryStream();
mystream->Write(buffer,99);
delete mystream;
}