DB/C Users

DB/C Users Forum
Subscribe Here!

 A BitDaddys Service

Go Back   DB/C Users > Open > Tutorials FAQs HowTos

Tutorials FAQs HowTos Here is the place to put and find Tutorials, FAQs and How Tos for DB/C related topics

Reply
 
Thread Tools Display Modes
  #1  
Old 12-27-2004, 10:19 AM
imported_birchfld imported_birchfld is offline
 
Join Date: Jul 2005
Posts: 6
Default using TCP/IP a DB/C example

Here is a simple example of how you can use DB/C to communicate via TCP.

It allows two separate programs to communicate with each other by sending messages and replies

(it is based on Don's example : DB/C DX sample web server ... Thanks Don!)

This example includes two programs

1. COMRECTEST.TXT - an example "server" program

2. COMSENDTEST.TXT - an example "client" program


To demonstrate :


Compile and run both of these programs on your computer.

Move both windows so that you can see each of there contents.

Give COMSENDTEST focus and type in anything like "hello"


Your message should show up in the COMRECTEST window and then it will be "echoed" back to COMSENDTEST.


This example is meant to show the concept of how you can use one program to either "remote-control" another program by sending commands, or use one program to send locally captured data to a remote computer.
Reply With Quote
  #2  
Old 04-26-2009, 05:27 AM
Brian Smith Brian Smith is offline
Junior Member
 
Join Date: Apr 2009
Posts: 2
Default Db/c & tcp/ip

Hi,

Is the source code for these 2 examples available? I have my own version but every so often the server program just "goes away". I'm sure I am missing something - just not sure what??

regards
Reply With Quote
  #3  
Old 04-26-2009, 09:51 AM
birchfld birchfld is offline
Administrator
 
Join Date: Feb 2006
Posts: 69
Default

hi Bryan,

A lot of the sample code can be found here:
http://dbcusers.com/showthread.php?t=107

The forum was h@cked quite some time ago, and when it was rebuilt under vbulletin ... many of the example attachments were orphaned.

I have used db/c and tcp/ip successfully to send requests / initiate communications . But have had difficulty in reliably receiving / monitoring ports.

As an example, I have client db/c apps that request backups to be initiated via an xml request to a server agent. But to make it fully reliable ... I had to build the server agent with C# .net

Sounds like we have run in to similar concerns.

Anyways, I went ahead and pulled these two examples out of the old zip, and attached them here for you.
Attached Files
File Type: src comrectest_945_488.src (5.6 KB, 4 views)
File Type: src comsendtest_301_103.src (3.7 KB, 4 views)

Last edited by birchfld; 04-26-2009 at 09:59 AM.
Reply With Quote
  #4  
Old 04-26-2009, 01:16 PM
Brian Smith Brian Smith is offline
Junior Member
 
Join Date: Apr 2009
Posts: 2
Default TCP/IP reliability

Thanks Keith,

I had found that example somewhere else and essentially I am using the same logic.

If the load on my server program is low then it works perfectly but when the load increases I get random DISCONNECT errors being reported by the client.

In my case the Server is DB/C legacy code that I dont want to re-write (yet) and the client is a VB.Net app that makes calls to my DB/C server to do *stuff*.

I have a theory that when the VB app starts to work hard that it may be trying to send when by DB/C server app is in the process of doing a COMCLOSE followed by a COMOPEN...

Also, what is the rationale behind having multiple COMFILE declarations - in my case the server will be 1:1 with the client??

regards
Brian
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -4. The time now is 04:41 PM.



Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
vB.Sponsors