Server Socket Question

Hi All,

Has anyone used server sockets with mixed socket types within addsocket? Ie. TCPsocket and say SSLSocket?
I think this shouldn’t be an issue, but I haven’t tried it yet and wanted to poll the field first.

Thanks!

Or is it recommended to just subclass another instance of Server Sockets to add the new SSLSockets? Which then leaves the original Server socket implementation using only TCPsocket?

Thanks!

I would keep them as separate sockets. I dont have a good reason why.

How would the serversocket know which one to use? It grabs a bunch at a time and uses one at random (well, not at random, but not within your control). Also, how would the client know which he’s connecting to? Best to keep them separate so they listen on separate ports, one for secure connections, one for unsecure.

You can use SSLSockets only, because if you don’t set secure = true, it’s still a normal TCPSocket.

Thanks guys that is what I thought and thanks for the tip Christian!

Tim I didn’t even think that far because I didn’t want to waste too much time playing with it knowing that I wasn’t sure how to implement them together. Thanks again!

[quote=95549:@Tim Hare]How would the serversocket know which one to use? It grabs a bunch at a time and uses one at random (well, not at random, but not within your control).
[/quote]
VERY good point and summarizes my OP perfectly.

[quote]
Also, how would the client know which he’s connecting to? Best to keep them separate so they listen on separate ports, one for secure connections, one for unsecure.[/quote]

Thank you Tim!