need a little string hint...
From: mferracini (maurizio.ferracini_at_gmail.com)
Date: 02/28/05
- Next message: Adrien Plisson: "Re: need a little string hint..."
- Previous message: Peter Hermann: "Re: Reading directories?"
- Next in thread: Adrien Plisson: "Re: need a little string hint..."
- Reply: Adrien Plisson: "Re: need a little string hint..."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
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");
- Next message: Adrien Plisson: "Re: need a little string hint..."
- Previous message: Peter Hermann: "Re: Reading directories?"
- Next in thread: Adrien Plisson: "Re: need a little string hint..."
- Reply: Adrien Plisson: "Re: need a little string hint..."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|