Login  
Search All Forums
Dart Home | PowerTCP Winsock for ActiveX | Custom Development Reply | PowerTCP Winsock for ActiveX Topics | Forums   
AuthorForum: PowerTCP Winsock for ActiveX
Topic: Powerbuilder receiving NULL terminating messages
aggelosp

From: Athens, Greece
Posts: 2
Member Since: 07/25/03
posted July 25, 2003 8:46 AM

While evaluating Winsock with PowerBuilder we are connecting to a service that sends null terminating messages.

In the control's receive event there is code that reads the messages:

string s
ole_tcp.object.receive(REF s)

Now, if the buffer contains more than one messages the variable s contains all the messages with CR/LF (2 bytes) separator between them, which are read with one method call to receive. Is this conversion performed implicitly by the control? What about CR/LF already in the original message, how can we distinguish them?

Thank you in advance
Aggelos

Tony Priest



From: Utica, NY USA
Posts: 8466
Member Since: 04/11/00
posted July 25, 2003 9:25 AM

No we would not do any conversion. If it's truly a NULL and you are using PowerBuilder, then you should only get the first message, since PowerBuilder considers a NULL to be the end of the string.

If you are expecting NULL chars, you may have to switch to using a Byte Array instead of a string. I don't know how to do this in PB but I believe there is a thread here somewhere where a customer described a solution.

Search on the word "Blob" in this forum and I think you will find it.
aggelosp

From: Athens, Greece
Posts: 2
Member Since: 07/25/03
posted July 25, 2003 12:37 PM

Tony thanks for the prompt reply.

Well, we tried calling receive passing an undimentioned blob variable and it seems to work. No apparent CR/LF in the resulting byte array. We then process the blob with appropriate methods to extract null terminating messages to string variables. I' ll post the code soon for others that maybe interested.

Thanks for the insight.

P.S. A sales question: If we go on and purchase the product is there a money-back warranty?
Tony Priest



From: Utica, NY USA
Posts: 8466
Member Since: 04/11/00
posted July 25, 2003 12:40 PM

Yes, there is a 30 day return policy.
Reply | PowerTCP Winsock for ActiveX Topics | Forums   
This site is powered by PowerTCP WebServer Tool PowerTCP WebServer for ActiveX