Re: [twsocket] HttpSvr send picture stream

2006-11-21 Thread xmedia
Thank you for the code. I have solved the problem. It was caused by other
modules which are not thread safe. The bug ate up HttpSvr's memory space. 

Best regards,
Kyin

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On
Behalf Of éric Fleming Bonilha
Sent: Sunday, November 19, 2006 11:58 PM
To: ICS support mailing
Subject: Re: [twsocket] HttpSvr  send picture stream

Hello,

I have developed something similiar to your needs on my application, I have
an HttpSrv that should send an internal stored JPEG to the clients over an
GET request to this JPEG, and it is working just fine, please check this
code, this should be implemented on CommandGET event (ICS 6) (Actually, my
source is written in Delphi, but should be easy to port to C++):

//Create the stream to send the data
StreamImg := TMemoryStream.Create;
try

  //Read the data from my internal JPEG buffer
  Cam.Comunicacao.HTTPImg.ReadImage(StreamImg);

  //Fill the file data and send
  AResponseInfo.ContentType   := 
FHTTP.MIMETable.GetFileMIMEType('.jpg');
  AResponseInfo.ContentLength := StreamImg.Size;
  AResponseInfo.WriteHeader;
  AContext.Connection.IOHandler.Write(StreamImg);

finally
  StreamImg.Free;
end;



- Original Message -
From: xmedia [EMAIL PROTECTED]
To: 'ICS support mailing' twsocket@elists.org
Sent: Sunday, November 19, 2006 1:49 AM
Subject: [twsocket] HttpSvr  send picture stream


 Hello!

 I am trying to send a JPEG stream stored in memory to HttpCli. Below is my
 code. It worked well for first few days and then the server (I mean the
 HttpSvr , not the application) just stopped responding to any http request
 until I restart the application.

 The cause seems to be related to server load. Because I can expediate the
 process by open a few clients requesting pictures at half second 
 interval -
 which can kill the http server over one night. I have been trying very 
 hard
 to find out what's wrong here with no luck. The source file is similar to
 theHttp Svr demo project - except I replaced the Time portion with JPEG
 stream.


 Here is what I put in OnGetDocument:

String URL = ((THttpConnection *)Client)-Path;
if(URL.SubString(1, 6)==/frame)
{

 Flags  = hgWillSendMySelf;
 frame[0]-Position = 0; //frames[0] is where the jpeg file stream
 stored. If saved to disk, you can get a jpeg file.
 String Header = HTTP/1.1 200 OK\r\n
 Content-Type: image/jpeg\r\n
 Content-Length:  + IntToStr(frame[0]-Size)+
 \r\n\r\n;

 TMemoryStream *Stream = new TMemoryStream;
 Stream-Write(Header.data(), Header.Length());
 Stream-CopyFrom(frame[0], 0);
 Stream-Seek(0, 0);

 Flags  = hgWillSendMySelf;
 ((TMyHttpConnection *)Client)-DocStream = Stream;
 ((TMyHttpConnection *)Client)-SendStream();
}

 Thanks - kyin

 -- 
 To unsubscribe or change your settings for TWSocket mailing list
 please goto http://www.elists.org/mailman/listinfo/twsocket
 Visit our website at http://www.overbyte.be
 

-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://www.elists.org/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be

-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://www.elists.org/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be


Re: [twsocket] THttpServer Authentication

2006-09-08 Thread xmedia
Thank you for all your help. I managed to get it work.:-) 

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On
Behalf Of Arno Garrels
Sent: Friday, September 08, 2006 2:41 PM
To: ICS support mailing
Subject: Re: [twsocket] THttpServer Authentication

xmedia wrote:
 Thanks SZ. But where do I get the password user sent? Do you have any 
 example? Sorry but I am a bit lost here...

Look at the (OverbyteIcs)Websrv demo in latest beta, there are several
events and properties dealing with authentication.
Next version will also include NTLM support.

---
Arno Garrels [TeamICS]
http://www.overbyte.be/eng/overbyte/teamics.html


 
 -Original Message-
 From: [EMAIL PROTECTED] [mailto:twsocket- 
 [EMAIL PROTECTED] On Behalf Of Fastream Technologies
 Sent: Friday, September 08, 2006 1:32 PM
 To: ICS support mailing
 Subject: Re: [twsocket] THttpServer Authentication
 
 That is a reference variable parameter! You need to pass the correct 
 password for the user specified to the component by assigning to the 
 variable!
 
 Regards,
 
 SZ
 
 - Original Message -
 From: xmedia [EMAIL PROTECTED]
 To: 'ICS support mailing' twsocket@elists.org
 Sent: Friday, September 08, 2006 8:30 AM
 Subject: [twsocket] THttpServer Authentication
 
 
 Hi,
 
 I am wondering anybody here can give an example on how to build a 
 password protected web server using THttpServer.
 
 I tried to setup a basic authentication for THttpServer. But it seems 
 that HttpServer1AuthGetPassword event always give an empty Password 
 (I use ShowMessage(Password) in C++ Builder).
 
 Thanks!
 Wang
 
 
 --
 To unsubscribe or change your settings for TWSocket mailing list 
 please goto http://www.elists.org/mailman/listinfo/twsocket
 Visit our website at http://www.overbyte.be
 
 --
 To unsubscribe or change your settings for TWSocket mailing list 
 please goto http://www.elists.org/mailman/listinfo/twsocket
 Visit our website at http://www.overbyte.be
--
To unsubscribe or change your settings for TWSocket mailing list please goto
http://www.elists.org/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be

-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://www.elists.org/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be


[twsocket] THttpServer POST data

2006-09-08 Thread xmedia
Anybody knows where I can find a web server demo that can process posted
data? For example, I want to get all data posted from a web form and save to
database. The current one came with ICS components only shows how to process
a GET request.
Any help is appreciated. Thanks.
wang

-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://www.elists.org/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be


[twsocket] THttpServer Authentication

2006-09-07 Thread xmedia
Hi,

I am wondering anybody here can give an example on how to build a password
protected web server using THttpServer.

I tried to setup a basic authentication for THttpServer. But it seems that
HttpServer1AuthGetPassword event always give an empty Password (I use
ShowMessage(Password) in C++ Builder).

Thanks!
Wang


-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://www.elists.org/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be


Re: [twsocket] TWSocket Digest, Vol 174, Issue 1

2006-06-19 Thread xmedia

Thanks Francois. You are right. I didn't use the latest version. I managed
to solve the problem by downloading the latest beta version. Thank you.
Wang
Date: Sun, 18 Jun 2006 19:27:25 +0200
From: Francois PIETTE [EMAIL PROTECTED]
Subject: Re: [twsocket] HttpCli user authentication whent get()
To: ICS support mailing twsocket@elists.org
Message-ID: [EMAIL PROTECTED]
Content-Type: text/plain; format=flowed; charset=iso-8859-1;
reply-type=original

Are you using the exact same URL with IE and the component ?
Have you tried with the sample program HttpTst provided with ICS ?
Which ICS version are you ising ? There are several authentication scheme. 
NTLM has been added not so long ago. Be sure to use the latest ICS (V5 or
V5) available from my website.

Another idea: maybe the camera software use cookies. You must grab the
cookie by first going to the main page and then you can access the image.

--
[EMAIL PROTECTED]
http://www.overbyte.be

-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://www.elists.org/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be


[twsocket] HttpCli user authentication whent get()

2006-06-18 Thread xmedia
I tried to set the Username and Password field in my HttpCli component when
accessing password protected IP camera without any success. I always get 401
error. But in IE I can enter the same user name and password in the pop=up
window to access. I am wondering whether I did anything wrong. My code is:

HttpCli1-Username=;

HttpCli1-Password=;

HttpCli1-URL+192.168.1.98/image.hpg;

HttpCli1-Get();

 

Any help is appreciated! Thanks in advance.

-WAng

-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://www.elists.org/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be