Webserver serving multiple connections simultanous
Posted: Sat May 28, 2016 4:45 pm
Hi,
Is it possible in FnxBasic to create a Webserver serving multiple connections simultanously (using the "ServerSocket")?
As far i can see it can handle multiple connections at the same time (there is an index on a socketconnection). This works fine as the client does the connect+disconnect (like if you use ServerSocket to create a chatbox).
But a browser does not disconnect, so the server has to close the connection with the browser as soon it has send al the data (webpage/image eg.) to the browser (or else the browser thinks there is coming more data and shows it is waiting on the disconnect).
There is an Active (True or False) or Open/Close, but his does not use an index to adress a particular socket connection to close, as far as i can see it closes all the socket connections.
I can create this in VB6 Using the WinSocket as the WinSocket itself is indexed, so if there are 5 browsers simultanous connecting there are 6 winsockets (5 comminucating with the browsers and the sixed(6) is the listener to accept a new connection. If the server has send all the to 1 of the browsers it disconnects(closes) the specific socket, so the browser knows it has all the data. The other sockets are not affected by this disconnect/close.
But i cannot get this to work using ServerSocket in FnxBasic, or i`m doing something completely wrong.
Can someone give me a hint?
Thanks
Martie.
Is it possible in FnxBasic to create a Webserver serving multiple connections simultanously (using the "ServerSocket")?
As far i can see it can handle multiple connections at the same time (there is an index on a socketconnection). This works fine as the client does the connect+disconnect (like if you use ServerSocket to create a chatbox).
But a browser does not disconnect, so the server has to close the connection with the browser as soon it has send al the data (webpage/image eg.) to the browser (or else the browser thinks there is coming more data and shows it is waiting on the disconnect).
There is an Active (True or False) or Open/Close, but his does not use an index to adress a particular socket connection to close, as far as i can see it closes all the socket connections.
I can create this in VB6 Using the WinSocket as the WinSocket itself is indexed, so if there are 5 browsers simultanous connecting there are 6 winsockets (5 comminucating with the browsers and the sixed(6) is the listener to accept a new connection. If the server has send all the to 1 of the browsers it disconnects(closes) the specific socket, so the browser knows it has all the data. The other sockets are not affected by this disconnect/close.
But i cannot get this to work using ServerSocket in FnxBasic, or i`m doing something completely wrong.
Can someone give me a hint?
Thanks
Martie.