addSocket() public méthode

public addSocket ( Ros_CSharp.CustomSocket.Socket s, SocketUpdateFunc update_func ) : bool
s Ros_CSharp.CustomSocket.Socket
update_func SocketUpdateFunc
Résultat bool
Exemple #1
0
        private bool initializeSocket()
        {
            if (!setNonBlocking())
            {
                return(false);
            }
            setNoDelay(true);
            setKeepAlive(use_keepalive, 60, 10, 9);

            if (string.IsNullOrEmpty(cached_remote_host))
            {
                if (is_server)
                {
                    cached_remote_host = "TCPServer Socket";
                }
                else
                {
                    cached_remote_host = ClientURI + " on socket " + sock;
                }
            }
            //Console.WriteLine("cached_remote_host = "+cached_remote_host);

            if (poll_set != null)
            {
                poll_set.addSocket(sock, socketUpdate, this);
            }
            if (!is_server && !sock.Connected)
            {
                close();
                return(false);
            }
            return(true);
        }