April 27, 2024, 03:03:33 PM

News:

IonicWind Snippit Manager 2.xx Released!  Install it on a memory stick and take it with you!  With or without IWBasic!


UDP Chat program for Creative Basic.

Started by Egil, March 13, 2011, 03:07:10 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Egil

Attached archive is a simple chat program communicating on your LAN using the UDP "protocol". It is coded using Creative Basic, and full source is enclosed.
The program retreives the LAN broadcast IP address automaticly, but during startup you get a chance to input a different IP address, and change the proposed port.

The source code is a conversion of the code I used for the EB UDP Chat program posted long time ago on this forum. But since CB doesn't accept multi-threading, my largest problem was to avoid loosing incoming data when using a timer controlled receiver.
But thanks to sapero the receiver now is event driven.

I have still to figure out how to get the startup dialog to accept the ENTER key whitout crashing the program, so the OK button MUST be used. If someone knows how to change this, please let me know.
And remember.... you use this program at your own risk!

Have fun!
Egil

Support Amateur Radio  -  Have a ham  for dinner!

aurelCB

Thanks Egil :)
Idea for that type of program is great!

Egil

Thanks Zlatko,
the next step is to make code to detect all computers on the LAN starting the program, and make routines for direct communication with every computer on a different port. But then I guess I'll need to make a primitive communications protocol to assure that no packets are lost. But maybe I leave that fun for others.... ;D

Regards
Egil
Support Amateur Radio  -  Have a ham  for dinner!