add secure method to tcpsocket