LoadRunner testing experience ftp mode

来源:互联网 发布:matlab如何输出数组 编辑:程序博客网 时间:2024/05/14 00:28

What is PASV mode (passive mode transfer)? How did he work?
FTPgenerally have two connections, one is a client process and servertransfer command, the other

is the data transmission connection. General support for both FTP server program
Different modes, one is Port mode, one is Passive Mode (Pasv Mode).

 

Assume that the client is C, the server for the S.
Port Mode:
Whena client C S connected to the server, using the Port mode, the client Csends a command to tell

the server S (the client C in the local open
Nwaiting for a port to connect your data), when the server S receivesthe Port command

will open to the client to connect to that port N,
The data connection is generated.
Pasv mode:
Whena client C S connected to the server, the server S will send theinformation to the client C, this information is (S server opens a portin the local M, you are now
Toconnect to me), when the client C receives this message, you can endthe service S,

M port to connect, the connection is successful, thedata connection is also established.

 

Action()

{

   char acTest[100];

   char acTest2[100];

   char * pcTest3;

 

//Send the string generated

  sprintf(acTest,"ddddggg/r/n");

 

//Send the string specified

lrs_set_send_buffer("socket0", acTest, strlen(acTest));


//Sent, due to run until lrs_set_send_buffer, so here's "buf0" Invalid parameters

lrs_send("sccket0","buf0",LrsLastArg);

 

//Receiving the returned string

lrs_receive("socket0","buf1",LrsLastArg);


//The returned string into variables

pcTest3=lrs_get_received_buffer("socket0",0,-1,NULL);


//Returns string of data manipulation

if(pcTest3[0]=='k')

{

  lrs_set_send_buffer ("socket0", pcTest3, strlen(pcTest3));

  lrs_send("socket0", "buf0", LrsLastArg);

  lrs_receive("socket0", "buf1", LrsLastArg);

}

原创粉丝点击