|
...... ......
loop:
rc = lrs_create_socket("socket1", "TCP", "RemoteHost=server:port", LrsLastArg);
if(rc!=0)
lr_message("Socket creatation failed!");
lrs_receive("socket1", "buf100", LrsLastArg);
rc=lrs_send("socket1", "buf101", LrsLastArg);
if(rc!=0)
lr_message("Send buf101 failed!");
lrs_receive("socket1", "buf102", LrsLastArg);
rc=lrs_send("socket1", "buf103", LrsLastArg);
if(rc!=0)
lr_message("Send buf103 failed!");
lrs_receive("socket1", "buf104", LrsLastArg);
lr_think_time(6);
rc=lrs_send("socket1", "buf105", LrsLastArg);
if(rc!=0)
lr_message("Send buf105 failed!");
rc=lrs_receive("socket1", "buf106", LrsLastArg);
lr_message("receive buf106 failed!");
mailnum=lrs_get_received_buffer ("socket1", 0, -1, NULL);
lr_message(mailnum);
if(strstr(mailnum, "+OK 1 ") == NULL){
lr_message("Have not received ! Wait......");
lrs_disable_socket("socket1", DISABLE_SEND_RECV);
lrs_close_socket("socket1");
goto loop;
}
...... ......
这样可以吗
[ 本帖最后由 selon 于 2007-4-3 15:14 编辑 ] |
|