Re: VB6 Winsock action on Server



jerry_ys wrote:

I have an app that needs to access a server using VB6 Winsock control. Should the app (server) on the server side be a std exe, or active x exe? which is better and why.

Option #3 - Windows Service.
AFAIK, both exe's and ActiveX exe's require someone to be logged onto the server machine in order that they can run. A Service will run all the time, even after everyone's gone home.
And yes; I know some people say don't write Windows Services in VB - I have and they've been run perfectly well (for several years now); you just need lots and /lots/ of error trapping code.

Next this server app will request services from a dll. My question is this. With multiple clients accessing this server app, will Winsock control keep the right requests for the right users and send back to the correct user the correct response?

Yes, but you have to use more than one of them, i.e. a Control Array.
Drop the WinSock control onto your Form, then set its Index property to zero. Then, (borrowed straight out of the WinSock Help)

Private Sub sckServer_ConnectionRequest( _
Index As Integer _
, ByVal requestID As Long _
)
Dim iIndex as Integer

If Index = 0 Then
iIndex = sckServer.Count
Load sckServer(iIndex)
sckServer(iIndex).LocalPort = 0
sckServer(iIndex).Accept requestID
End If
End Sub

As each Connection is accepted, you get another Socket loaded and operating, each dealing with its own connection.

Can someone please comment on this situation and explain how the objects on the server side keep track of clients?

As the code above demonstrates, a single "listener" socket waits for new, incoming connections. As each connection arrives, the "listener" hands the connection off to another socket; this socket then deals exclusively with that connection, leaving the "listener" waiting for any new ones.

I have not seen any clear explanation in books and manuals i have seen.

HTH,
Phill W.
.



Relevant Pages

  • Re: Outgoing POP3 email missing/lost/not received
    ... Funny thing is that I have had this ISP for 8 years and it has always been ... It looks like when you last ran CEICW, you set the ISP's mail server to: ... Internet Connection Wizard. ... After the wizard completes, the following network connection ...
    (microsoft.public.windows.server.sbs)
  • Re: Cannot connect client to server 2003
    ... you need to reconfigure the IP schema of your SBS ... On the SBS 2003 Server open the Server Management console. ... On the Connection Type page, click Broadband, and then click Next. ... Alternate DNS server, type the IP addresses that are provided by your ISP ...
    (microsoft.public.windows.server.sbs)
  • Re: Outgoing POP3 email missing/lost/not received
    ... ISP's mail server instead of the domain name on the ... SUMMARY OF SETTINGS FOR CONFIGURE E-MAIL AND INTERNET ... Internet Connection Wizard. ... After the wizard completes, the following network connection ...
    (microsoft.public.windows.server.sbs)
  • Re: Networking Question - VLANs on SBS 2003 Premium SP1
    ... port on the old router so I now have a segregated WLAN. ... be sure you do not enable any DHCP server in internal network. ... On the Connection Type page, click Broadband, and then click Next. ... On the Network Connection, You must enable and configure the network ...
    (microsoft.public.windows.server.sbs)
  • Re: Still cant connect to RWW or OWA remotely
    ... it certainly appears to be something about the SBS configuration. ... Meridian.local Ethernet adapter Local Area Connection: ... Windows SMALL BUSINESS SERVER 2003 Windows IP Configuration ... 192.168.254.254) directly to a port on the router and then ...
    (microsoft.public.windows.server.sbs)