Closed jefflunt closed 2 years ago
This turns out not really to be feasible because on the server-side of a messenger the call to accept
in order to accept an incoming TCP connection returns a socket directly. As such, constructors must accept this socket in order to work for both client/server sides.
This doesn't really change anything in terms of capabilities and limitations, except that I thought it would make things easier to deal with. Instead it made it harder.
As of this writing, messengers take a socket as the only constructor parameter. However, if
nmspec
is to abstract away most of the connection details, then passing ahost
andport
makes more sense as the interface.In addition to switching over to
host
andport
, messengers should also support:true
/false
predicate method that returnstrue
if the socket is fully connected, andfalse
otherwise should be sufficient.