查了帮助的命令集,描述如下:
clientsend(num socket, str message[, num charlength])
Description:
This command sends a message across the socket specified as socket. The value passed as socket is the number returned by clientcreate(). The charlength is the length of the string being passed and is usually optional. Needed only if the string being sent has NULL characters in it.
Example:
clientsend(1,"REQ:service");
这个命令我没有用过,查阅了一些资料,希望能给你帮助。
clientsend()语句的描述中出现了clientcreat()
这个命令是用于创建用于TCP/IP 协议的端口使用的。
This command creates a new client socket that is set to communicate using the TCP/IP protocol.
通过这个命令,可以在不同的服务器之间传递消息。
问题1:第一个是端口号,这个端口号是之前的命令clientcreate()返回的,如果要使用的话,要先用creat,比如写成:
int port=clientcreat();
clientsend(port, "REQ:service");