[AWS] AWS.Client
Dmitriy Anisimkov
anisimkov at ada-ru.org
Thu Sep 13 13:05:07 CEST 2007
Adrian Hoe 贺文耀 wrote:
>
>> What is the parameter Kind in the Server_Push.Register call ?
>> If you use Kind => Multipart and Content_Type = 'image/jpeg' you could
>> see the images
>> in the Firefox, Mozilla or SeaMonkey browsers.
>
> I don't understand this question.
See latest package AWS.Server.Push
line 99.
There is declared
procedure Register
(Server : in out Object;
Client_Id : in Client_Key;
Socket : in Net.Socket_Type'Class;
Environment : in Client_Environment;
Init_Data : in Client_Output_Type;
Init_Content_Type : in String := "";
Kind : in Mode := Plain;
Duplicated_Age : in Duration := Duration'Last;
Groups : in Group_Set := Empty_Group;
Timeout : in Duration :=
Default.Send_Timeout);
I guess you are using it to register the server-push clients on the
server side.
I want to know the parameter "Kind" value you are using.
> There is software running on Windows and I don't think I am going to
> invest in WIntel machines and run Windows only for that purpose. I
> want to run on my Macs which I use for my daily computing.
>
> Are there any other options?
I don't understand the question. AWS is a portable library.
>
>
>>> The server will send (push) continuous frames of JPEG still images to
>>> the browser giving the motion effects.
>>>
>>> According to doc, I can use Read_Some or Read to receive the JPEG
>>> frames with connection created with Server_Push => True.
>> Not to receive frames, but to read server-push stream. separation to the
>> frames is not supported for now.
>> There is simple separation method Read_Untill delimiter. But it is not
>> fit for binary data.
>
> Doesn't the server push the images stream frame by frame at a time?
I Do not understand the question.
> How about the comment regarding Last < Data'First or Last < Data'Last?
> Which one is correct?
procedure Read
(Connection : in out HTTP_Connection;
Data : out Ada.Streams.Stream_Element_Array;
Last : out Ada.Streams.Stream_Element_Offset);
-- Reads data from the client's connection until Data buffer if filled
-- or it reached the end of the response. Returns Last < Data'Last if
-- there is no more data available in HTTP response. Connection have
-- to be created with parameter Server_Push => True.
It is correct. It is trying to fill the buffer.
procedure Read_Some
(Connection : in out HTTP_Connection;
Data : out Ada.Streams.Stream_Element_Array;
Last : out Ada.Streams.Stream_Element_Offset);
-- Reads any available data from the client's connection.
-- If no data available, it will wait for some data to become
available or
-- until it timeouts. Returns Last < Data'First when there is no data
-- available in the HTTP response. Connection have to be created with
-- parameter Server_Push => True.
It is correct too. It is trying to get any data portion.
More information about the AWS
mailing list