Login  
Search All Forums
Dart Home | PowerTCP Server for ActiveX | Custom Development Reply | PowerTCP Server for ActiveX Topics | Forums   
AuthorForum: PowerTCP Server for ActiveX
Topic: PowerBuilder Server Control multithread
john80

From: Rome, Italy
Posts: 2
Member Since: 12/02/10
posted December 2, 2010 6:23 AM

Hi, I'm using OLE Server Control in a PB "server application".

This application is listening on a port and then start receiving data. That's ok, the application do the job.

But when it's receiving data on a "child" it seems to be blocked. So if there is another incoming request on the same port the server control wait until the old child become "free". It doesn't create another "child" for the new incoming request. I set "child.Timeout = 0" and on the OLE server I set "ole_server.ReuseAddress = TRUE".

In the ole_server RECEIVE event I wrote:

child.Timeout = 0
child.Receive(REF data_in)

/* some business logic */

child.Send(data_out)
child.Close()


I read on the Help file that Server Control can manage multiple connection: how can I do that in PowerBuilder?

Thanx!

Nick B (Admin)

From: Utica, NY USA
Posts: 619
Member Since: 05/25/10

Extra Support Options
Custom Application Development

posted December 3, 2010 1:34 PM

Hello,

I'm afraid we are unable to provide any PowerBuilder specific support, but what you should be looking to do is spawn a new thread to respond to the event (passing in whatever necessary parameters) so that the code is not processed on the UI thread. It may help to examine the 'Creating a multi-threaded server' topic under Quick Start in the help documentation.

------
-Non-current subscribers must contact sales@dart.com to update subscription and receive continued support as needed.
------

john80

From: Rome, Italy
Posts: 2
Member Since: 12/02/10
posted December 4, 2010 3:16 AM

Thank you anyway, I'll try to "translate" VB code.

Another question: in the example you mentioned there is no "child.close"...in which event do I have to call this method?

I mean: in the "DoEcho" class after the "child.send" or in the "server receive event"?

Thanx!
Nick B (Admin)

From: Utica, NY USA
Posts: 619
Member Since: 05/25/10

Extra Support Options
Custom Application Development

posted December 6, 2010 9:36 AM

Hi,

You'd want to call child.Close() in the new thread (in DoEcho).

------
-Non-current subscribers must contact sales@dart.com to update subscription and receive continued support as needed.
------

Reply | PowerTCP Server for ActiveX Topics | Forums   
This site is powered by PowerTCP WebServer Tool PowerTCP WebServer for ActiveX