Exemplo n.º 1
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
//ORIGINAL LINE: @Override protected void create(boolean stream) throws java.io.IOException
        protected internal override void Create(bool stream)
        {
            if (!stream)
            {
                throw new UnsupportedOperationException("Must be a stream socket");
            }
            Fd = SdpSupport.createSocket();
            if (Socket_Renamed != null)
            {
                Socket_Renamed.SetCreated();
            }
            if (ServerSocket_Renamed != null)
            {
                ServerSocket_Renamed.SetCreated();
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// Creates a socket with a boolean that specifies whether this
        /// is a stream socket (true) or an unconnected UDP socket (false).
        /// </summary>
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
//ORIGINAL LINE: protected synchronized void create(boolean stream) throws java.io.IOException
        protected internal override void Create(bool stream)
        {
            lock (this)
            {
                this.Stream = stream;
                if (!stream)
                {
                    ResourceManager.beforeUdpCreate();
                    // only create the fd after we know we will be able to create the socket
                    Fd = new FileDescriptor();
                    try
                    {
                        SocketCreate(false);
                    }
                    catch (IOException ioe)
                    {
                        ResourceManager.afterUdpClose();
                        Fd = null;
                        throw ioe;
                    }
                }
                else
                {
                    Fd = new FileDescriptor();
                    SocketCreate(true);
                }
                if (Socket_Renamed != null)
                {
                    Socket_Renamed.SetCreated();
                }
                if (ServerSocket_Renamed != null)
                {
                    ServerSocket_Renamed.SetCreated();
                }
            }
        }