wjla1 发表于 2008-7-31 18:13:59

SOCKET报文问题

long file_stream;
char *filename = "d:\\baowen.txt";
Action()
{
intNumberOfBytes;
int i, total = 0;

memset(&buffer, 0, sizeof(buffer));

if ((file_stream = fopen(filename, "r")) == NULL )
{
   lr_error_message("Cannot open %s", filename);
   return -1;
}


    whiel((feof(file_stream) )== 0)
    {
          ch = fgetc(file_stream); /* Read in the next character */
          buffer = ch; /* Place the new char at the end of the buffer */
   }

   /* Add null to end the buffer converting it to a string */
   buffer = NULL;
    lr_message("buffer= %s\n, buffersizeof = %d\n", buffer, sizeof(buffer));

    lrs_create_socket("socket1","TCP","RemoteHost=localhost:9212",LrsLastArg);



   lrs_set_send_buffer("socket1", buffer, strlen(buffer) );
   lrs_send("socket1", "buf0", LrsLastArg);

   lrs_close_socket("socket1");

}

运行后提示:
error:Unable to translate to socket1. error 9013

问题:
从文件读入的数据到数组中,不能发到服务器吗?

[ 本帖最后由 wjla1 于 2008-8-1 01:53 编辑 ]
页: [1]
查看完整版本: SOCKET报文问题