AdaSockets

码农软件 · 软件分类 · 网络工具包 · 2019-08-31 10:59:12

软件介绍

AdaSockets 是一个 Ada 95 的 socket 编程开发包,支持单播和多播套接字,使用面向对象结构来简化套接字操作。

示例代码:

with Ada.Command_Line; use Ada.Command_Line;
with Ada.Exceptions; use Ada.Exceptions;
with Ada.Text_IO; use Ada.Text_IO;
with Sockets.Stream_IO; use Sockets, Sockets.Stream_IO;

procedure Stream_Sender is

   -- Usage: stream_sender remotehost remoteport
   -- Example: stream_sender localhost 5000

   Outgoing_Socket : Socket_FD;
   Stream : aliased Socket_Stream_Type;
   Line : String (1 .. 200);
   Last : Natural;

begin
   if Argument_Count /= 2 then
      Raise_Exception
        (Constraint_Error'Identity,
         "Usage: " & Command_Name & " remotehost remoteport");
   end if;

   Socket (Outgoing_Socket, PF_INET, SOCK_STREAM);
   Connect (Outgoing_Socket, Argument (1), Positive'Value (Argument (2)));
   Initialize (Stream, Outgoing_Socket);

   loop
      Put ("Type a string> ");
      Flush;
      Get_Line (Line, Last);
      String'Output (Stream'Access, Line (Line'First .. Last));
   end loop;

exception
   when End_Error => null;
end Stream_Sender;

本文地址:https://codercto.com/soft/d/13560.html

MacTalk 人生元编程

MacTalk 人生元编程

池建强 / 人民邮电出版社 / 2014-2-1 / 45

《MacTalk·人生元编程》是一本随笔文集,主要内容来自作者的微信公众平台“MacTalk By 池建强”。本书撰写于2013年,书中时间线却不止于此。作者以一个70 后程序员的笔触,立于Mac 之上,讲述技术与人文的故事,有历史,有明天,有技术,有人生。70 多篇文章划分为六大主题:Mac、程序员与编程、科技与人文、人物、工具、职场。篇篇独立成文,可拆可合,随时阅读。 此外,作者还对原来......一起来看看 《MacTalk 人生元编程》 这本书的介绍吧!

CSS 压缩/解压工具
CSS 压缩/解压工具

在线压缩/解压 CSS 代码

RGB转16进制工具
RGB转16进制工具

RGB HEX 互转工具

MD5 加密
MD5 加密

MD5 加密工具