From: Eric Hodel Date: 2008-08-14T08:46:15+09:00 Subject: Re: Comparing TCP sockets On Aug 13, 2008, at 14:08 PM, Iņaki Baz Castillo wrote: > Hi, imagine I receive a TCP connection and I store the TCPSocket in a > variable "io_1": > > io_1 = io > > If I do "io_1.peeraddr" I can see the remote address. > > If latter the connection is closed by the peer and I do > "io_1.peeraddr" then I > get an Exception because socket closed (ok). > > Imagine later the *same* connection is received and I store it in > "io_2". > Will "io_1 == io_2" return true? No. > or should I compare "peeraddr" Array fields one by one (address, > port...)? You can compare the Arrays without going field by field.