请教TIdUDPServer组件中SendBuffer函数的用法
我想用TIdUDPServer编一个文件传输程序,服务器和客户端用的都是TIdUDPServer
大概的思路是服务器端接到客户端要求发送的消息后就开始发送数据,我打算用SendBuffer发送,但是遇到了一个问题,我不知道怎么指定发送地址,因为TIdUDPServer中没有类似与RemotHost之类的属性
查了一下帮助,给出的SendBuffer原型为:
procedure SendBuffer(AHost: string; const APort: Integer; var ABuffer; const AByteCount: integer);
作为服务器来说不可能预先知道用户的IP的,那函数声明中的AHost该怎么填呢?
帮助的函数描述中给出了下面一句话:
SendBuffer will use the protocol stack to resolve the host name in AHost to an IP address.
这是不是说就不用填了呢???