I would like to have your opinion guys about the following situation.
I m trying to develope a messenger like Yahoo/MSN in VB 6 using Winsock. I am thinking about how the server should be made so
that it can cater to many users simultaneously.

Procedure will be as follows:

(a) A client requests login by sending userid and password to the server.
(b) The server checks it in the database and send the result TRUE or FALSE. TRUE means login correct and FALSE means login
incorrect.
(c) After receiving TRUE from server the client sends a message to the server asking to send the contact list.
(d) The server picks contact list from the database and sends it to the client.
(e) Client A sends a message to Client B which arrives at the server.
(f) The server then sends this message to Client B.

There could be many other features like adding a buddy in contact list, deleting him, blocking him e.t.c which I have ignored.

Now the techniques that I may use in developing the server are:


Technique 1
-----------------------

(1) I put a winsock control on a form listening on port 5000.
(2) This single winsock control will be used to login, sending message, loading contact list.
(3) The index property of this control would be 0.
(4) Every time a new connection requests arrive I load a new winsock control increasing the index by 1. For example

Code:
Private Sub serverSocket_ConnectionRequest(Index As Integer, ByVal requestID As Long)
    If Index = 0 Then
        lngConnectionNumber = lngConnectionNumber + 1
        
        Load serverSocket(lngConnectionNumber)
        serverSocket(lngConnectionNumber).LocalPort = 0
        serverSocket(lngConnectionNumber).Accept requestID
    End If
End Sub
(5) There will be seperate subroutines/functions for login, sending message and loading contact list.


Advantages of technique 1
------------------------------------------
(1) Easy to program.


Disadvantages of technique 1
----------------------------------------------
(1) I don't think it is a multi-threaded server or is it!?
(2) If a client request comes for login and the server is busy then if at the same time another requests comes from some other client to send a message then he will have to wait because server is busy with the login process.


Technique 2
-----------------------

(1) I put 3 different winsock controls on a single form.
(2) All the 3 controls will listen on 3 different ports which are 5000, 5001 and 5002 respectively.
(3) Each winsock control will be used for login, sending message and loading contacts respectively.
(4) The index property of each control will be 0.
(5) Every time a new connection requests arrive I load a new winsock control increasing the index by 1. For example

Code:
Private Sub LoginServer_ConnectionRequest(Index As Integer, ByVal requestID As Long)
    If Index = 0 Then
        lngLoginNumber = lngLoginNumber + 1
        
        Load LoginServer(lngLoginNumber)
        LoginServer(lngLoginNumber).LocalPort = 0
        LoginServer(lngLoginNumber).Accept requestID
    End If
End Sub

Private Sub MessageServer_ConnectionRequest(Index As Integer, ByVal requestID As Long)
    If Index = 0 Then
        lngMessageNumber = lngMessageNumber + 1
        
        Load MessageServer(lngMessageNumber)
        MessageServer(lngMessageNumber).LocalPort = 0
        MessageServer(lngMessageNumber).Accept requestID
    End If
End Sub

Private Sub ContactServer_ConnectionRequest(Index As Integer, ByVal requestID As Long)
    If Index = 0 Then
        lngContactNumber = lngContactNumber + 1
        
        Load ContactServer(lngContactNumber)
        ContactServer(lngContactNumber).LocalPort = 0
        ContactServer(lngContactNumber).Accept requestID
    End If
End Sub
(6) There will be seperate subroutines/functions for login, sending message and loading contact list. (and there are separete winsock controls also for these tasks remember).


Advantages of technique 2
------------------------------------------
(1) It may act like a multi threaded server.
Although here unlike technique 1 there are 3 different winsock controls for 3 different tasks even then I think the client will have to wait in case of two requests at the same time. Because even though controls are 3, the form is single so once loginserver is busy authenticating a client if another client sends a message he will have to wait because control cannot be transfered to SendMessage function as server is already busy in Login. What do you guys say!?


Disadvantages of technique 2
----------------------------------------------
(1) A little difficult to program.



Technique 3
--------------------

(1) I put 3 different winsock controls on 3 different forms. (each control on each form)
(2) All the 3 controls will listen on 3 different ports which are 5000, 5001 and 5002 respectively.
(3) Each winsock control will be used for login, sending message and loading contacts respectively.
(4) The index property of each control will be 0.
(5) Every time a new connection requests arrive I load a new winsock control increasing the index by 1 same as technique 2.
(6) There will be seperate subroutines/functions for login, sending message and loading contact list. (and there are separete winsock controls also on 3 separate form remember).


Advantages of technique 3
------------------------------------------
(1) It may be truly a multi-threaded server. (not sure)
Because now there are three separate controls on three separate forms. So if a client send request for Login and another
client sends a message then the server will not remain busy with Login as it is on different form with different control. In this way both Login and SendingMessage will work simulatneously.


Disadvantages of technique 3
---------------------------------------------
(1) Very difficult to program.
(2) I don't think it is logicalyl correct to use this technique or is it!? The server should be one which will have mulitple threads instead of using three different servers (winsock controls). Isn't it!?


Please give me your comments on the techniques above. As I said earlier my goal is to make a multi-threaded server so if you
think that none of the above is a multi-threaded server and you have a better idea then please tell me.