![]() |
![]() DB/C Users Forum Subscribe Here! |
![]() A BitDaddys Service |
|
|||||||
| Tutorials FAQs HowTos Here is the place to put and find Tutorials, FAQs and How Tos for DB/C related topics |
![]() |
|
|
Thread Tools | Display Modes |
|
#1
|
|||
|
|||
|
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. |
|
#2
|
|||
|
|||
|
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 |
|
#3
|
|||
|
|||
|
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. Last edited by birchfld; 04-26-2009 at 09:59 AM. |
|
#4
|
|||
|
|||
|
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 |
![]() |
| Thread Tools | |
| Display Modes | |
|
|