[PD] new [tcpserver] (was: pd and tcp: what to do against crashes?)

Roman Haefeli reduzierer at yahoo.de
Sat Mar 7 19:54:34 CET 2009


hi again

a new stupid little problem occured. when working with [tcpserver], i
usually identify the clients by their socket number and not by their
client number; for two reasons: when a message is received or a new
client connects, you can only know the socket number of it (since there
is a dedicated socket outlet), but not the client id. the other reason
is that socket numbers are persistent, while client numbers might
change, if one or more clients disconnect or get disconnected. my
problem is, that the new status outlet and also the method to set
internal buffersize is based on the client number. it's not a that big
problem, since whenever i sent a message to a socket number i will know
the client number as well. but when receiving messages, you don't know
which client it came from. i though about building a look-up table in
order to look up a socket for its client number, but this is not very
feasible, since the client id might not be valid anymore after one or
more disconnects. 
what i want to say, that it is currently not handy to use the new
features, because you are forced to work in both domains, client and
socket, at the same time. personally, i would prefer if everything would
be socket based and i think, if you want to change it, then better now
than later.
another solution (though uglier, imho) would be to implement an internal
look-up: 'get_client_id <socket>' -> [tcpserver] -> 'client_id <client>'
to the status outlet.

what do you think?

roman





	
		
___________________________________________________________ 
Der frühe Vogel fängt den Wurm. Hier gelangen Sie zum neuen Yahoo! Mail: http://mail.yahoo.de





More information about the Pd-list mailing list