<div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">El mar, 18 de may. de 2021 a la(s) 10:44, John Dovey (<a href="mailto:dovey.john@gmail.com">dovey.john@gmail.com</a>) escribió:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div dir="ltr"></div><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, 18 May 2021 at 09:25, T Lee Davidson <<a href="mailto:t.lee.davidson@gmail.com" target="_blank">t.lee.davidson@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
The socket objects representing connections to unique clients are contained in an array of objects (ie. the Clients object <br>
array). When a connection request is received, a unique socket is created with ServerSocket.Accept() and is added to the Clients <br>
array (list?) with Clients.Add(); one socket per unique client. All the sockets created are attached to the "Socket" event <br>
observer. [<a href="http://gambaswiki.org/wiki/comp/gb.net/serversocket/accept" rel="noreferrer" target="_blank">http://gambaswiki.org/wiki/comp/gb.net/serversocket/accept</a>]<br>
<br>
When a message is received from a client, the Socket_Read() event handler is triggered. Now, since we don't know exactly which <br>
client sent the message, we can use the Last keyword which represents whichever server socket received the current message from <br>
its connected client. And since Last, in this case, is a handle on a socket, all the properties and methods of Socket are <br>
available to us (ie. Last.RemoteHost).<br>
<br></blockquote><div>Thank you for the explanation. I'm going to have to step through my program in debug mode until I understand exactly what is happening and what information is stored where, because that's still not entirely clear to me. </div></div></div></blockquote><div><br></div><div>is pretty difficult to understand but it seems managing client sockets is a bit more elaborated, so we must iterate in all our connected clients using LAST until we have all the required information right?</div><div><br></div><div><br></div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div class="gmail_quote"><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
I'm not sure exactly what you mean by, "manage the full session with the client." Isn't the function of a chat server to <br>
basically forward a message sent by one client to all the other clients? What management of individual clients would be necessary?<br><br></blockquote><div><br></div><div>I'm not quite sure what would be "necessary". That's what I'm trying to figure out. One aspect of where I'm heading is to have the server accept a remote connection, then spawn off a brand new form which will echo locally what is happening on the remote. The idea I have here, and I'm really stumbling in the dark, is I'd like to have a client-server setup where I can generate cairo commands on the server and send them to the remote client where they would be rendered. I want to also render them locally so that I can send (on the client's request) an SVG/PNG/PDF version of what's been rendered. I did something similar many years ago using Winsock connections, but there I had to maintain my own in-memory table of connections etc. </div><div><br></div><div>To start with, I'd like to be able to just Telnet to the port I'm listening on, receive a text menu, and then send a menu choice and have the server respond depending on that choice. I'll figure it out eventually. </div><div><br></div><div>Thanks again for all your help.</div><div>John</div><div><br></div></div></div>
<br>
----[ <a href="http://gambaswiki.org/wiki/doc/netiquette" rel="noreferrer" target="_blank">http://gambaswiki.org/wiki/doc/netiquette</a> ]----<br>
</blockquote></div></div>