A better Picture Server

Xbase++ 2.0 Build 554 or later
Post Reply
Message
Author
User avatar
rdonnay
Site Admin
Posts: 4729
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

A better Picture Server

#1 Post by rdonnay »

If you have installed Xbase++ 2.0, here is a better version of the picture server sample program.

The sample program included with Xbase++ is located in C:\users\<username>\documents\xbase++\source\samples\multitier\pictureserver.
You would run PictureServer.Exe to start up the picture server and then click on Start followed by Start Browser.

This will load an HTML page (websocketpictureserver.htm) into your webbrowser that contains Javascript which will connect to the picture server and allow you to navigate thru the pictures which are stored in a database.

Unzip the attached file into that same folder and run pbuild dcpict.xpj to build dcpictserver.exe and dcpictclient.exe.

You will notice that the UI of dcpictserver.exe looks nearly identical to the UI of pictureserver.exe except for an additional button.
dcpictserver.prg has been simplified to be much easier to read and is only half the lines of code because it uses eXpress++ DC* commands.
It is also in a single prg file instead of 4 prg files, which is difficult to follow the disjointed code.

I also wrote a dcpictclient.exe. This is a program that connects to either the PictureServer.Exe or DCPictServer.Exe. It is an Xbase++ (eXpress++) program that will show the pictures.

If you are interested in learning more about HttpEndPoint(), WebSocketClient(), WebSocketHandler() and WebHandler() then these 2 sample programs will get you started.

If you were at the spring devcon in Boise, then you saw a sample scrabble program (named Snyffle) that I wrote a few years ago. It used Xb2net for both the client and server program. I have now converted it to work without Xb2net. It uses some new DC_* functions which will be available in the next eXpress++ build. The conversion was very easy and only took me about 2 hours. I am working on converting the IM system to eliminate Xb2net also. That too will be in the next eXpress++ build.
Attachments
dcpict.zip
(3.87 KiB) Downloaded 752 times
The eXpress train is coming - and it has more cars.

Cliff Wiernik
Posts: 605
Joined: Thu Jan 28, 2010 9:11 pm
Location: Steven Point, Wisconsin USA
Contact:

Re: A better Picture Server

#2 Post by Cliff Wiernik »

I think it would be useful to have available both the before (xb2net) and after (non-xb2net) snyffle program for review to get an understanding of the changes. We have the xb2net based IM code available, but not the snyffle code at this point. We discussed having this code available in the next Express++ build.

User avatar
rdonnay
Site Admin
Posts: 4729
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: A better Picture Server

#3 Post by rdonnay »

Yes, both versions of Snyffle and IM will be available.
The eXpress train is coming - and it has more cars.

skiman
Posts: 1185
Joined: Thu Jan 28, 2010 1:22 am
Location: Sijsele, Belgium
Contact:

Re: A better Picture Server

#4 Post by skiman »

Hi,

I understood before that this httpendpoint wasn't ready for production environment? Does this mean that the problems are solved?
Best regards,

Chris.
www.aboservice.be

User avatar
rdonnay
Site Admin
Posts: 4729
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: A better Picture Server

#5 Post by rdonnay »

I understood before that this httpendpoint wasn't ready for production environment? Does this mean that the problems are solved?
HttpEndPoint() works fine with WebHandler(), WebSocketClient() and WebSocketHandler().

It just isn't ready yet for all CXP applications.
The eXpress train is coming - and it has more cars.

Post Reply