Pchp.Library.Streams.SocketStream.SetParameter C# (CSharp) Method

SetParameter() public method

public SetParameter ( StreamParameterOptions option, PhpValue value ) : bool
option StreamParameterOptions
value Pchp.Core.PhpValue
return bool
        public override bool SetParameter(StreamParameterOptions option, PhpValue value)
        {
            if (option == StreamParameterOptions.ReadTimeout)
            {
                int timeout = (int)(value.ToDouble() * 1000.0);
                socket.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.ReceiveTimeout, timeout);
                socket.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.SendTimeout, timeout);
                return true;
            }
            return base.SetParameter(option, value);
        }