In this sheet we are going to explain how the program works. The program does Server and Client and uses the dll wsock32.dll. This Dynamic Link Library was created in 1993 (Version 1.1) by a team of several engineers. Windows has normally its own dll called wininet.dll with its API but this one (dll) is only "easy to use" with a Client and not with a Server. The particularity of wsock32.dll holds all simply in its manner to connect itself like Server or Client in an asynchronous way.
Therefore put only one copy on two computers having a connexion on Internet (In all manner it will be impossible to you to bind twice same port: here it is 21120.).
Try to know the exact I.P of the two machines; for that do Start--Control Panel--Network Connections--click right (mouse's button) on Icon of Connection then choose Properties--then enable ---Show icon in notification area when connected---then click on OK---a little icon appear in task bar close to clock...click left on this icon then choose Status then choose Tab Support and you will see your I.P (For ADSL it is always the same it is like a phone number.).For AOL user you can also do same thing but if you want to keep secret your I.P click on help (AOL software) then on About america online then when window is opened do Ctrl+Y and you will see appear a number (Local I.P)...(you have up to 5 local I.P and at each connection this-on change (5 values)).
Now let's pass to the explanation of the program...:
When program is loaded it creates two sockets ( hClient & hServer ) and hServer waits an hClient connection...(You have to put some files in folder Share, folder Incoming is here to receive files from the Server.). If you have an AntiVirus try to put port: 21120 in/out in your Firewall.
Synoptic:
Before all things try to see the following site WinSock32 ; it is MSDN of Microsoft...
When one copy is opened one on a Server and one on Client, we can open the menu File then click on sub menu Connect...a window appear and you have to put the I.P of the Server then click on button OK...
When the connection is established between Server and Client, the Client receive a FD_CONNECT message and Server a FD_ACCEPT message...For the Client this involves an instruction to put a title in the BarWindow of the window...For Server in more to put title in BarWindow it creates a thread SendShareProgram...(this last serves to send files from folder Share to the ListBox of Client.).Try to see alone how this thread works...
Now when List of all files shared is listed in ListBox of Client program, you may choose a file with mouse then double-click or press ENTER...File is now downloading...from Server to Client...we can see two progressbars...
Thank you very much for your attention.
GChapillon@aol.com