need a little string hint...

From: mferracini (maurizio.ferracini_at_gmail.com)
Date: 02/28/05


Date: 28 Feb 2005 08:08:35 -0800

i need to read from a file "config.sys" host&port number.
but i have a problem with host...

if i call: Get_Host_By_Name ("localhost") it work fine,
i i use the string read from the file don't work.

an hint?

grazie.

-------------------------------------------------------------

procedure Client is
   Server : Sock_Addr_Type;
   Config : Ada.Text_Io.File_Type;
   Host : String (1 .. 20) := (others => ' ');
   Port_Value : String (1 .. 20) := (others => ' ');
   Last : Natural := 0;
   Port : Port_type := 0;

begin
   --Inizializza
    --leggi da config
   Ada.Text_Io.Open(
      File => Config,
      Mode => Ada.Text_Io.In_File,
      Name => "config.ini"); --case sensitive?

   Ada.Text_Io.Get_Line(
      File => Config,
      Item => Host,
      Last => Last);

   Ada.Text_Io.Get_Line(
      File => Config,
      Item => Port_Value,
      Last => Last);
   Ada.Integer_Text_Io.Get(Port_Value,natural(Port),Last);

    --open socket
   Initialize(False); --true??
   Server.Addr := Addresses (Get_Host_By_Name (host), 1);
   Server.Port := Port;
   Ada.Text_Io.Put_Line("OK");



Relevant Pages

  • Re: Winsock CGI
    ... .RemoteHost = Host ... End With ... Private Sub Winsock1_Connect ... Private Function encode(s as string) as string ...
    (microsoft.public.de.vb)
  • Re: (The Transport Batch flush operation failed) + Custom Adapter
    ... > at System.Diagnostics.EventLog.CreateEventSource(String source, String ... > EventLogEntryType type, Int32 eventID, Int16 category, ByterawData) ... > If the messages were not transmitted to BizTalk and I stopped the Host, ...
    (microsoft.public.biztalk.general)
  • Re: Question about authentication protocols
    ... >> Host sends Alice a random string. ...
    (sci.crypt)
  • Hosting ASP.Net fails after upgrade to .Net 2
    ... The ApplicationBase for my app is "/MyApp" so the statement in the error ... Here's the code that creates the host: ... public static Host Create(Type HostType, string VirtualDir, string ... assemblies have been loaded in the new AppDomain, so it is too late to set ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: What is the best way to define the Imported C function
    ... Ada's String is not C's ... Firstly Integer is not necessarily int, ... Host: out Unbounded_String; ... Display: out Display_ID; ...
    (comp.lang.ada)