PB Networking Code Example

Just starting out? Need help? Post your questions and find answers here.
Karbon
PureBasic Expert
PureBasic Expert
Posts: 2010
Joined: Mon Jun 02, 2003 1:42 am
Location: Ashland, KY
Contact:

PB Networking Code Example

Post by Karbon »

Hey guys, I'd appreciate any comments on some networking code. I did it mostly as an exercise but I have to do something like this for a project coming up and wanted to get the hang of it. Also wanted to provide it as a tutorial for other users..

Included is a small server and client, let me know what you think!

Download Zip

Thanks!
-Mitchell
Check out kBilling for all your billing software needs!
http://www.k-billing.com
Code Signing / Authenticode Certificates (Get rid of those Unknown Publisher warnings!)
http://codesigning.ksoftware.net
Karbon
PureBasic Expert
PureBasic Expert
Posts: 2010
Joined: Mon Jun 02, 2003 1:42 am
Location: Ashland, KY
Contact:

Post by Karbon »

30+ people have downloaded it - any comments?

Just a "hey it works on my Windows XXXX machine" would be great!

Thanks!
-Mitchell
Check out kBilling for all your billing software needs!
http://www.k-billing.com
Code Signing / Authenticode Certificates (Get rid of those Unknown Publisher warnings!)
http://codesigning.ksoftware.net
Henrik
Enthusiast
Enthusiast
Posts: 404
Joined: Sat Apr 26, 2003 5:08 pm
Location: Denmark

Post by Henrik »

Hi Karbon
Great code :D
Sorry i didnt responde sooner but i have very littel time right now. :(

Your code is working just fine, Running win 98 se :D

I like your programming style, makes it verry easy to read even without your very well documented remarkes, this of course makes it easyer to understand, even if you are new to networking.

So overall, i think that your code is good basis to build on.

The only thing i would object to, is to use Callback for too much code, like keeping the callback as clean as possible.

Like.

Code: Select all

If Message = #NETWORK_EVENT
     NetworkProcedure()
ElseIF   Message =#WM_SIZE
     ResizeProcedure()
ElseIF   Message = #Bla.Bla
     BlaProcedure()
EndIF ; End Message 
Or something like that, but thats how i like stuff 8)

Best regards
Henrik.
Karbon
PureBasic Expert
PureBasic Expert
Posts: 2010
Joined: Mon Jun 02, 2003 1:42 am
Location: Ashland, KY
Contact:

Post by Karbon »

Right-o about the callback, I will mod the comment to say something about that..

Thanks for the nice words! Glad you like it!
-Mitchell
Check out kBilling for all your billing software needs!
http://www.k-billing.com
Code Signing / Authenticode Certificates (Get rid of those Unknown Publisher warnings!)
http://codesigning.ksoftware.net
woki
User
User
Posts: 23
Joined: Fri Apr 25, 2003 4:48 pm
Location: Germany

Post by woki »

Hi,

works with XP prof. SP1 local (127.0.0.1) and over the network (server on XP prof.SP1 - client on Windows ME)
LJ
Enthusiast
Enthusiast
Posts: 177
Joined: Wed Apr 30, 2003 4:00 pm

Can't seem to....

Post by LJ »

Can't get the client side to connect to network. I'm using a linksys box and no "base" system network configuration, peer to peer. Both computers on my network communicate to the linksys box with an IP address, a subnet mask, and then an SSID.
Karbon
PureBasic Expert
PureBasic Expert
Posts: 2010
Joined: Mon Jun 02, 2003 1:42 am
Location: Ashland, KY
Contact:

Post by Karbon »

Hmm, I'm not sure what the problem might be..I'll have to look into what OpenNetworkConnection() requires..
-Mitchell
Check out kBilling for all your billing software needs!
http://www.k-billing.com
Code Signing / Authenticode Certificates (Get rid of those Unknown Publisher warnings!)
http://codesigning.ksoftware.net
LJ
Enthusiast
Enthusiast
Posts: 177
Joined: Wed Apr 30, 2003 4:00 pm

OK

Post by LJ »

Ok, sounds great. Let me know what you find out. I'll test any code you write. Networking is a universe onto itself, I know you understand what I mean by this. A tutorial on networking would be awesome if you find out enough information. Keep me posted.
Tranquil
Addict
Addict
Posts: 952
Joined: Mon Apr 28, 2003 2:22 pm
Location: Europe

Post by Tranquil »

Its C++ related but it helped me very much due to learning networking:


http://www.codeproject.com/internet/?Display=title

Greetz
Mike
Tranquil
Post Reply