Basic4ppc - Windows Mobile Development  

Go Back   Basic4ppc - Windows Mobile Development > Main Category > Code Samples & Tips > Additional Libraries
Home Register FAQ Members List Search Today's Posts Mark Forums Read

Additional Libraries Users contributed libraries.
This sub-forum is only available to licensed users.


Network "library"


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 11-10-2007, 05:55 PM
agraham's Avatar
Basic4ppc Expert
 
Join Date: Jul 2007
Location: Cheshire, UK
Posts: 1,700
Awards Showcase
Beta Tester Forum Contributer 
Total Awards: 2
Default Network "library"

This is not a library as in "compiled dll" but it is as in "reusable code" so this is probably the best place for it.

I have been wanting to do two things. First to communicate between separate apps on the desktop and secondly to communicate between my device and desktop apps. I can do both with this network "library" that builds on network.dll!

Handling errors and structuring network code to be robust can be difficult so in doing the work I have implemented it as a reusable library and have provided defined interfaces to the code so that you don't need to know what is happening to use it. There is a comment region that tries to explain how.

I have included the "library" code in a demo app. This app can talk to another instance of itself, one being the server and the other the client. For the client to connect the server must be open first. You can use either a host name or an IP address. The default is "localhost" - your computer. Run two instances on your desktop - open one as the server and then the other as a client and type away! Your firewall may complain so you may have to let it know the programs are OK.

I have tested this over my WiFi network between all combinations of my Vista desktop, XP laptop and WM2003SE device, each being both server and client, with no problems.

I'm quite pleased with this and hope it might be useful to someone else.


EDIT :- I have just noticed an error in the comments for the network code. The line -

' netServerConnecting - the application must implement this know the server has a client

wasn't changed when I altered the final code and should be -

' netConnecting - the application must implement this to know that server and client are connected. It occurs for both server and client.
Attached Files
File Type: zip NetDemo.zip (116.0 KB, 161 views)

Last edited by agraham : 11-11-2007 at 10:02 AM.
Reply With Quote
  #2 (permalink)  
Old 11-10-2007, 06:09 PM
Cableguy's Avatar
Basic4ppc Expert
 
Join Date: Apr 2007
Location: N 41º11'30.30" W 8º39'46.60"
Posts: 1,321
Awards Showcase
Forum Contributer 
Total Awards: 1
Default

Very ussefull piece of code....

Thanks for all your hard work!
__________________
Paulo Gomes
Porto, Portugal

PC: Dual-Core 1,8Ghz, 2GB RAM, 80GB HD
PPC: Qtek9000, 1GB SD

DLL Version Listing
Reply With Quote
  #3 (permalink)  
Old 11-11-2007, 10:32 AM
dzt's Avatar
dzt dzt is offline
Basic4ppc Veteran
 
Join Date: May 2007
Location: Greece
Posts: 353
Awards Showcase
Beta Tester Forum Contributer 
Total Awards: 2
Default

Nice piece of code.
__________________
Dimitris Zacharakis
http://www.terracom.gr
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
"AddEvent" and "buttonUp/buttonDown" Byak@ Questions & Help Needed 12 09-10-2008 04:04 PM
Neuling bei Basic4ppc - wollte mal "Hallo" sagen ... JOTHA German Forum 49 08-29-2008 12:59 AM
Is there any thing like Visual Basic "Tabbed dialog control" in Basic4ppc? mozaharul Questions & Help Needed 6 03-23-2008 12:07 PM
Image Button kommt nicht wieder "hoch" troll German Forum 3 02-22-2008 10:03 AM
calling the device's "Programs" or "settings" screens HarleyM Questions & Help Needed 0 12-05-2007 03:59 AM


All times are GMT. The time now is 11:07 PM.


Powered by vBulletin® Version 3.6.12
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.1.0