Genreal Design Questions.

Nomad.net

New member
Joined
Jan 29, 2009
Messages
1
Programming Experience
10+
Sudo Code to start :)

Hello everyone!

I've been programing in vb6.0 for years and to be accepted for a new job i must learn all the in's and out's of vb.net 2008 or vs.net with the 3.5 framework. The only part of that however is the VB side, not C++ or C#.

So I've been rewriting a bunch of old programs in VB.net and I'm getting stuck quite often, but google has helped me wonders. but there are a few things I'm lost on. IE I don't know what to type in to search :p

The current program I'm working on is a client server login with data return.

Client side is small, just a sockets with a few txtboxes.
Server side receives the connection and query's an access db for the information to return. (The server side is much more complex however i'll just cover one stage at a time.)

Sudo code:
Client-
Name:
Password
encrypt with Crypto.Encrypt key updated every XXX not important :p
Open connection via sockets to server
wait
receive result
if username and password are valid login
if not display result code IE bad username etc..
close socket

Server-
open database.(server holds db open as long as it's running)
wait for client to connect
client connects
validates key using the same encryption algorithm as the client
search records for username
if found check password
if password is ok sent ok result and access level (1-10)
close connection..
wait for next connection.


My questions are.. is there a better(faster) way to do this? What happens if 2 clients connect at the same time? Once again I'm just talking about sockets.. I'll get to the database code after I've got a working connection. Between 50-100 clients could be connecting at any time.

And any links pointing to a very detailed but understandable page on how to use sockets in vb.net would be much app. :)
 
You can have thousands of simultaneous connections really. The TcpListener will listen at some port and each client will connect to it, server accepting connection by a AcceptTcpClient call for example, then you'd handle the communication for each client in its own thread. Any tutorial/example for TcpListener/TcpClient will get you going, help also has examples for both, and you should look for tutorials to learn multi-threading in general.
 
Back
Top