Example #1
0
        /// <summary>
        /// Binds the socket to the local address.  This can be called multiple times per socket.
        /// </summary>
        /// <param name="address">The addr argument consists of two parts as follows: transport://address. The transport specifies the underlying transport protocol to use. The meaning of the address part is specific to the underlying transport protocol.</param>
        /// <returns>An endpoint identifier which can be used to reference the bound endpoint in the future</returns>
        /// <exception cref="NNanomsg.NanomsgException">Thrown if the address is invalid</exception>
        protected NanomsgEndpoint BindImpl(string address)
        {
            int endpoint = -1;

            endpoint = Interop.nn_bind(_socket, address);

            if (endpoint > 0)
            {
                return new NanomsgEndpoint()
                       {
                           ID = endpoint
                       }
            }
            ;
            else
            {
                throw new NanomsgException("nn_bind " + address);
            }
        }
Example #2
0
 public static int Bind(int s, string addr)
 {
     return(Interop.nn_bind(s, addr));
 }