SOCKET客户端是用DELPHI写的,SOCKET服务器是UNIX的,功能是这样的,在收到客户端发送的字符串之后,服务器返回相应的信息,然后断开连接,客户端我用的是TcpClient控件,想用TcpClient1.Receiveln接受服务器返回的消息,但是一直收不到,请问该怎么接受?相应代码如下:
try
if TcpClient1.Connect then
for I := 0 to memSend.Lines.Count - 1 do
TcpClient1.Sendln(memSend.Lines[I]);
finally
TcpClient1.Receiveln;
end;
try
if TcpClient1.Connect then
for I := 0 to memSend.Lines.Count - 1 do
TcpClient1.Sendln(memSend.Lines[I]);
finally
TcpClient1.Receiveln;
end;
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货