TCP/IP(六)

*@///0000000B01*)

(*@/// procedure t_ftp.WndProc(var Msg : TMessage); *)
procedure t_ftp.WndProc(var Msg : TMessage);
var
  temp_socket:TSocket;
  sockinfo: TSockAddr;
begin
  if msg.msg<>uwm_socketevent+1 then
    inherited WndProc(Msg)
  else begin
    if msg.lparamhi=socket_error then
    else begin
      case msg.lparamlo of
(*@///         fd_accept: *)
fd_accept: begin
  temp_socket:=f_socket;
  self.f_socket:=accept_socket_in(f_socket,sockinfo);
  close_socket(temp_socket);
  end;
(*@///0000000401*)
(*@///         fd_write: *)
fd_write: begin
  case f_mode_intern of
    tftp_download,
    tftp_getdir:   ;
    tftp_upload: do_write;
    end;
  end;
(*@///000000010B*)
(*@///         fd_read: *)
fd_read: begin
  case f_mode_intern of
    tftp_download,
    tftp_getdir:   do_read;
    tftp_upload: ;
    end;
  end;
(*@///0000000201*)
        fd_connect:  ;   (* can be ignored, a fd_write will come *)
(*@///         fd_close: *)
fd_close: begin
{   case f_mode_intern of }
{     tftp_download: finish_download; }
{     tftp_getdir:   finish_getdir; }
{     tftp_upload:   finish_upload; }
{     end; }
  end;
(*@///0000000701*)
        end;
      end;
    end;
  end;
(*@///0000000C01*)

(*@/// function t_ftp.getdirentry:t_filedata; *)
function t_ftp.getdirentry:t_filedata;
begin
  result:=empty_filedata;
  while (f_cur_dir_index<f_cur_dir.count) and ((result.filetype=ft_none)
      or (result.name='.') or (result.name='..')) do begin
    result:=parse_ftp_line(f_cur_dir[f_cur_dir_index]);
    inc(f_cur_dir_index);
    end;
  end;
(*@///0000000601*)

(*@/// function t_ftp.read_line_comm:string; *)
function t_ftp.read_line_comm:string;
begin
  result:=read_line(f_comm_socket);
  end;
(*@///0000000401*)
(*@/// procedure t_ftp.SendCommand(const s:string); *)
procedure t_ftp.SendCommand(const s:string);
begin
  write_s(f_comm_socket,s+#13#10);
  if assigned(f_tracer) then
    f_tracer(s,tt_proto_sent);
  end;
(*@///0000000321*)
(*@///0000000C01*)

{ Time, RExec, LPR - the most useful UNIX services }
(*@/// class t_time(t_tcpip) *)
(*@/// constructor t_time.Create(Aowner:TComponent); *)
constructor t_time.Create(Aowner:TComponent);
begin
  inherited create(AOwner);
  f_Socket_number:=37;
  f_time:=0;
  f_timemode:=tzUTC;
  end;
(*@///0000000601*)

(*@/// procedure t_time.action; *)
procedure t_time.action;
var
  ok:integer;
  b: byte;
  bias: integer;
begin
  login;
  f_time:=0;
  while not eof(f_socket) do begin
    read_var(f_socket,b,1,ok);
    if ok=1 then
      f_time:=f_time*256+b;
    end;
  f_time:=f_time/86400+encodedate(1900,1,1);
  if f_timemode<>tzUTC then begin
(* Alternative: use SystemTimeToTzSpecificLocalTime, but only works in NT *)
    bias:=TimeZoneBias;
    f_time:=f_time-bias/1440;  (* bias is in minutes *)
    end;
  end;
(*@///0000000901*)
(*@///0000000310*)
(*@/// class T_RCommon(t_tcpip) *)
(*@/// procedure t_rcommon.open_socket_out(var socket:TSocket; Socket_number:smallint;ip_address:longint); *)
procedure t_rcommon.open_socket_out(var socket:TSocket; Socket_number:smallint;ip_address:longint);
begin
  close_socket(socket);
  socket:=Create_Socket;
  bind_socket(socket,512,1023);
  connect_socket(socket,Socket_number,ip_address);
  end;
(*@///0000000113*)
(*@/// procedure t_rcommon.action; *)
procedure t_rcommon.action;
var
  p: pointer;
  ok,ok2:integer;
begin
  login;
  while not eof(f_socket) do begin
    read_var(f_socket,f_buffer^,buf_size,ok);
    p:=f_buffer;
    while ok>0 do begin   (* just to be sure everything goes into the stream *)
      ok2:=f_stream.write(p^,ok);
      dec(ok,ok2);
      p:=pointer(longint(p)+ok2);
      end;
    end;
  f_stream.seek(0,0);  (* set the stream back to start *)
  logout;
  end;
(*@///0000000113*)
(*@///000000021B*)
(*@/// class t_rexec(t_rcommon) *)
(*@/// constructor t_rexec.Create(Aowner:TComponent); *)
constructor t_rexec.Create(Aowner:TComponent);
begin
  inherited create(AOwner);
  f_Socket_number:=512;   (* rexec *)
  end;
(*@///0000000501*)
(*@/// procedure t_rexec.login; *)
procedure t_rexec.login;
begin
  inherited login;
  self.write_s(f_socket,f_user+#0);
  self.write_s(f_socket,f_pass+#0);
  self.write_s(f_socket,f_command+#0);
  end;
(*@///0000000410*)
(*@///0000000201*)
(*@/// class t_rsh(t_rcommon) *)
(*@/// constructor t_rsh.Create(Aowner:TComponent); *)
constructor t_rsh.Create(Aowner:TComponent);
begin
  inherited create(AOwner);
  f_Socket_number:=514;   (* rsh *)
  end;
(*@///0000000401*)
(*@/// procedure t_rsh.login; *)
procedure t_rsh.login;
begin
  inherited login;
  self.write_s(f_socket,'0'+#0);        (* port for stderr, NYI *)
                                        (* must be a listening port on the
                                           client's side, within the reserved
                                           port range 512..1023 *)
  self.write_s(f_socket,f_user_r+#0);   (* remote *)
  self.write_s(f_socket,f_user_l+#0);   (* local *)
  self.write_s(f_socket,f_command+#0);  (* command to execute *)
  end;
(*@///0000000401*)
(*@///0000000201*)
(*@/// class T_lpr(t_tcpip) *)
(*@/// constructor t_lpr.Create(Aowner:TComponent); *)
constructor t_lpr.Create(Aowner:TComponent);
begin
  inherited create(AOwner);
  f_Socket_number:=515;
  f_printtype:=lp_ascii;
  f_count:=1;
  end;
(*@///000000060E*)

(*@/// procedure t_lpr.open_socket_out(var socket:TSocket; Socket_number:smallint;ip_address:longint); *)
procedure t_lpr.open_socket_out(var socket:TSocket; Socket_number:smallint;ip_address:longint);
begin
  close_socket(socket);
  socket:=Create_Socket;
  bind_socket(socket,512,1023);
  connect_socket(socket,Socket_number,ip_address);
  end;
(*@///0000000501*)
(*@/// procedure t_lpr.action; *)
procedure t_lpr.action;
begin
  login;
  SendPrintData;
  logout;
  end;
(*@///0000000501*)
(*@/// procedure t_lpr.SendPrintData; *)
procedure t_lpr.SendPrintData;
var
  ok:integer;
  i: integer;
  s: string;
  job_name: string;
  config_stream: TMemoryStream;
begin
  (* sanity checks *)
  if (f_queue='') or (f_stream.size=0) or (f_count=0) or (f_user='') then EXIT;
  s:=#02+f_queue+#10;
  write_s(f_socket,s);
  self.response;
  job_name:=inttostr(lpr_count+1000);
  job_name:=copy(job_name,length(job_name)-2,3)+my_hostname;
(*@///   collect and send the description data *)
config_stream:=NIL;
try
  config_stream:=TMemorystream.Create;
(*@///   H originating host *)
s:='H'+ip2string(my_ip_address)+#10;
stream_write_s(config_stream,s);
(*@///0000000120*)
(*@///   P responsible user *)
s:='P'+copy(f_user,1,31)+#10;
stream_write_s(config_stream,s);
(*@///*)
(*@///   M address to send the mail to *)
if f_user_mail<>'' then begin
  s:='M'+f_user_mail+#10;
  stream_write_s(config_stream,s);
  end;
(*@///0000000303*)
(*@///   J jobname (for banner) *)
if f_jobname<>'' then begin
  s:='M'+copy(f_jobname,1,99)+#10;
  stream_write_s(config_stream,s);
  end;
(*@///0000000401*)
(*@///   C class name = host name of sender (for banner) *)
s:='C'+copy(my_hostname,1,99)+#10;
stream_write_s(config_stream,s);
(*@///*)
(*@///   L banner page *)
if f_banner then begin
  s:='L'+f_user+#10;
  stream_write_s(config_stream,s);
  end;
(*@///0000000303*)
(*@///   T title (for lp_pr only) *)
if f_title<>'' then begin
  s:='T'+copy(f_title,1,79)+#10;
  stream_write_s(config_stream,s);
  end;
(*@///0000000303*)
(*@///   the print command itself *)
case f_printtype of
  lp_plain:   s:='l';
  lp_ascii:   s:='f';
  lp_dvi:     s:='d';
  lp_plot:    s:='g';
  lp_ditroff: s:='n';
  lp_ps:      s:='o';
  lp_pr:      s:='p';
  lp_fortran: s:='r';
  lp_troff:   s:='t';
  lp_raster:  s:='v';
  lp_cif:     s:='c';
  end;
s:=s+job_name+#10;
for i:=1 to f_count do
  stream_write_s(config_stream,s);
(*@///*)
(*@///   U unlink the file after the printing *)
s:='U'+jobname+#10;
stream_write_s(config_stream,s);
(*@///*)
(*@///   send the data *)
config_stream.seek(0,0);  (* set the stream back to start *)
s:=#02+inttostr(config_stream.size)+' cfA'+job_name+#10;
write_s(f_socket,s);
self.response;
ok:=1;
while ok>0 do begin
  ok:=config_stream.read(f_buffer^,buf_size);
  write_buf(f_socket,f_buffer^,ok);
  end;
write_s(f_socket,#0);   (* finish the config data *)
(*@///*)
finally
  config_stream.free;
  end;
(*@///0000001007*)
(*@///   send the data to print *)
s:=#03+inttostr(stream.size)+' dfA'+job_name+#10;
write_s(f_socket,s);
self.response;
f_stream.seek(0,0);  (* set the stream back to start *)
ok:=1;
while ok>0 do begin
  ok:=f_stream.read(f_buffer^,buf_size);
  write_buf(f_socket,f_buffer^,ok);
  end;
write_s(f_socket,#0);   (* finish the plot *)
(*@///000000081E*)
  inc(lpr_count);
  end;
(*@///0000001001*)
(*@/// procedure t_lpr.GetQueueStatus(detailed:boolean); *)
procedure t_lpr.GetQueueStatus(detailed:boolean);
var
  p: pointer;
  ok,ok2:integer;
  s: string;
begin
  if (f_queue='') then EXIT;
  if detailed then
    s:=#04+f_queue+#10
  else
    s:=#03+f_queue+#10;
  write_s(f_socket,s);
  while not eof(f_socket) do begin
    read_var(f_socket,f_buffer^,buf_size,ok);
    p:=f_buffer;
    while ok>0 do begin   (* just to be sure everything goes into the stream *)
      ok2:=f_stream.write(p^,ok);
      dec(ok,ok2);
      p:=pointer(longint(p)+ok2);
      end;
    end;
  f_stream.seek(0,0);  (* set the stream back to start *)
  end;
(*@///0000001503*)
(*@/// procedure t_lpr.response; *)
procedure t_lpr.response;
var
  b: byte;
  ok: integer;
begin
  read_var(f_socket,b,1,ok);
  if (ok<>1) or (b<>0) then
    raise EProtocolError.Create('LPR','',999);
  end;
(*@///0000000305*)

{ remove jobs }
{ get status }
(*@///0000000501*)

{ The Mail and News protocols }
(*@/// class t_smtp(t_tcpip) *)
(*@/// constructor t_smtp.Create(Aowner:TComponent); *)
constructor t_smtp.Create(Aowner:TComponent);
begin
  inherited create(AOwner);
  f_Socket_number:=25;
  f_receipts:=TStringList.Create;
  f_body:=TStringList.Create;
  end;
(*@///0000000501*)
(*@/// destructor t_smtp.Destroy; *)
destructor t_smtp.Destroy;
begin
  f_receipts.Free;
  f_body.Free;
  inherited destroy;
  end;

标题基于Flask框架的微博大数据分析与可视化系统实现AI更换标题第1章引言介绍微博大数据分析与可视化系统的研究背景、意义、现状及论文的创新点。1.1研究背景与意义阐述微博大数据分析在信息传播、舆情监控等领域的重要性。1.2国内外研究现状分析国内外微博大数据分析与可视化系统的研究进展与现状。1.3论文创新点概述本文在微博大数据分析与可视化系统方面的创新之处。第2章相关理论介绍Flask框架及微博大数据分析与可视化的相关理论。2.1Flask框架基础阐述Flask框架的特点、优势及基本应用。2.2大数据分析技术介绍大数据分析的基本原理、方法及常用工具。2.3数据可视化技术讨论数据可视化技术的种类、应用场景及实现方法。第3章系统设计详细介绍基于Flask框架的微博大数据分析与可视化系统的设计方案。3.1系统架构设计给出系统的整体架构、模块划分及各模块功能。3.2数据库设计阐述数据库的设计思路、表结构及数据关系。3.3界面设计介绍系统的用户界面设计原则、布局及交互方式。第4章系统实现阐述基于Flask框架的微博大数据分析与可视化系统的实现过程。4.1数据采集与预处理介绍微博数据的采集方法、预处理流程及数据清洗技术。4.2数据分析与挖掘详细介绍数据分析与挖掘的算法、模型及实现过程。4.3可视化展示阐述数据可视化展示的实现方法,包括图表类型、交互设计等。第5章系统测试与优化对基于Flask框架的微博大数据分析与可视化系统进行测试与优化。5.1系统测试方法介绍系统测试的方法、步骤及测试用例设计。5.2测试结果分析对测试结果进行详细分析,包括性能指标、稳定性评估等。5.3系统优化策略提出系统优化的策略,包括算法优化、代码优化等。第6章结论与展望总结本文的研究成果,并展望未来的研究方向。6.1研究结论概括本文的主要研究结论和系统实现效果。6.2展望指出本文研究的不足之处以及未来在微博大数据
内容概要:本文档详细介绍了基于Peng-Robinson状态方程的Matlab代码实现方法,系统性地研究了纯组分与多组分系统的压缩因子(z因子)和逸度系数的计算过程,并进一步拓展至泡点压力与露点压力的确定。该资源聚焦于化工热力学中的核心相平衡问题,通过Matlab编程实现了物性参数的数值求解,涵盖方程求根、迭代算法设计、相态判别等关键技术环节,有助于深入理解实际气体行为及混合物相平衡特性。文档同时展示了该技术在油气工程、化学过程模拟等领域的应用潜力,并列举了多个相关科研方向,体现出其在多学科交叉仿真研究中的支撑价值。; 适合人群:具备化工热力学基础知识及Matlab编程能力的高校学生、科研人员和工程技术人员,尤其适合从事流程模拟、石油天然气工程、反应工程及化工系统优化等方向的硕博研究生与研发工作者。; 使用场景及目标:①开展化工过程中涉及真实气体物性计算的科研项目;②完成化工原理、热力学课程设计或学位论文中的相平衡计算模块开发;③作为Matlab在化工计算中应用的教学案例或实验指导材料;④为复杂多组分体系的工业流程模拟与工艺优化提供算法基础和技术参考。; 阅读建议:建议读者结合经典化工热力学教材深入理解Peng-Robinson方程的理论推导与适用条件,在此基础上通过Matlab代码动手实现迭代求解流程,重点关注初值选取、收敛判断与多重解处理等细节,同时可借鉴文档中提及的相关研究方向拓展科研视野与应用思路。
内容概要:本文系统研究了基于多种智能优化算法(包括布谷鸟搜索CS、大象群体优化EHO、灰狼优化GWO、帝王蝴蝶优化MBO、鲨鱼群算法SSA和粒子群优化PSO)的物联网无人机基站部署问题,重点通过Matlab代码实现对无人机基站的位置优化、通信覆盖范围建模及网络传输性能提升进行仿真分析。研究涵盖了算法对比、路径规划、资源分配与通信效率优化等关键环节,深入探讨了不同智能算法在复杂环境下的收敛性、稳定性与适用性,突出其在提升无线网络覆盖率与系统容量方面的实际应用价值。; 适合人群:具备一定Matlab编程基础,从事通信工程、物联网技术、智能优化算法研究的高校学生、科研人员及工程技术人员,特别适合聚焦无人机通信网络优化方向的硕博研究生与相关领域开发者。; 使用场景及目标:①用于科研项目中无人机基站布局优化的算法选型与仿真验证;②支撑学术论文复现与新型智能优化算法的开发与测试;③为智能算法在无线通信网络中的实际部署提供可运行的Matlab实现案例与技术参考; 阅读建议:建议读者结合提供的Matlab代码逐模块运行与调试,重点关注各优化算法在无人机基站选址与覆盖优化中的实现流程,并可通过调整参数设置或引入新算法开展对比实验,以深化对智能优化机制及其在通信系统中集成应用的理解。
下载代码方式:https://pan.quark.cn/s/a4b39357ea24 **Vue.js 框架全面解析** Vue.js 是一种轻量级且高性能的前端JavaScript框架,因其便捷性、适应性和可扩展性而备受开发者青睐。在“nodejs+vue”的在线购物平台中,Vue.js 主要承担构建用户界面的任务,并提供数据绑定、组件化、路由管理等关键功能。 1. **数据绑定**:Vue.js 的核心优势之一是双向数据绑定,它借助 `v-model` 指令将视图与数据模型建立联系,确保视图层的变动能即时同步到数据模型,同时数据模型的变化也能实时反映在视图上。在在线购物平台中,这一特性可用于商品列表的动态展示和购物车状态的即时调整。 2. **组件化**:Vue.js 提供了功能强大的组件体系,允许开发者将用户界面拆分为独立且可复用的模块。例如,在在线购物平台中,商品展示模块、购物车功能、支付流程等均可封装为组件,从而提升代码的复用性和可维护性。 3. **指令与过滤器**:Vue.js 中的指令如 `v-if`、`v-for` 和 `v-bind` 用于控制元素的渲染方式及行为,过滤器则能对数据进行格式化处理,例如货币显示、时间格式转换等。在在线购物平台中,这些功能有助于更有效地展示商品信息并优化用户交互体验。 4. **计算属性与侦听器**:计算属性能够监测多个数据源并输出计算结果,而侦听器则能在数据变动时执行指定操作。在在线购物平台中,计算属性可用于自动计算购物车总金额,侦听器则可响应库存变动并实时更新商品状态。 5. **Vue Router 路由管理**:在单页应用(SPA)环境中,Vue Router 是不可或缺的组件,它负责管理页面间的导航和...
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值