#[derive(Default, Debug, Clone, Ord, PartialOrd, Eq, PartialEq, Hash)]
#[derive(Deserialize, Serialize)]
#[serde(default, deny_unknown_fields)]
pub struct GlobalSocketConfiguration
{
pub socket_busy_read: Option<BusyPollMicroseconds>,
pub socket_busy_select_and_poll: Option<BusyPollMicroseconds>,
pub socket_maximum_back_log: Option<BackLog>,
pub socket_not_sent_low_water_in_bytes: Option<NotSentLowWaterInBytes>,
pub socket_adjust_auto_corking: Option<bool>,
pub global_maximum_send_buffer_size_in_bytes: Option<SendBufferSizeInBytes>,
pub global_default_send_buffer_size_in_bytes: Option<SendBufferSizeInBytes>,
pub global_maximum_receive_buffer_size_in_bytes: Option<ReceiveBufferSizeInBytes>,
pub global_default_receive_buffer_size_in_bytes: Option<ReceiveBufferSizeInBytes>,
pub global_maximum_control_message_buffer_size_in_bytes: Option<ControlMessageBufferSizeInBytes>,
}
impl GlobalSocketConfiguration
{
pub fn configure(&self, proc_path: &ProcPath) -> Result<(), GlobalSocketConfigurationError>
{
use self::GlobalSocketConfigurationError::*;
instance_set_value(proc_path, BusyPollMicroseconds::set_global_default, self.socket_busy_read, CouldNotChangeGlobalDefaultSocketBusyRead)?;
instance_set_value(proc_path, BusyPollMicroseconds::set_global_select_and_poll_default, self.socket_busy_select_and_poll, CouldNotChangeGlobalDefaultSocketBusySelectAndPoll)?;
instance_set_value(proc_path, BackLog::set_global_maximum, self.socket_maximum_back_log, CouldNotChangeGlobalMaximumBackLog)?;
instance_set_value(proc_path, NotSentLowWaterInBytes::set_global_default, self.socket_not_sent_low_water_in_bytes, CouldNotChangeGlobalDefaultNotSentLowWater)?;
instance_set_value(proc_path, SendBufferSizeInBytes::set_global_maximum, self.global_maximum_send_buffer_size_in_bytes, CouldNotChangeGlobalMaximumSendBufferSize)?;
instance_set_value(proc_path, SendBufferSizeInBytes::set_global_default, self.global_default_send_buffer_size_in_bytes, CouldNotChangeGlobalDefaultSendBufferSize)?;
instance_set_value(proc_path, ReceiveBufferSizeInBytes::set_global_maximum, self.global_maximum_receive_buffer_size_in_bytes, CouldNotChangeGlobalMaximumReceiveBufferSize)?;
instance_set_value(proc_path, ReceiveBufferSizeInBytes::set_global_default, self.global_default_receive_buffer_size_in_bytes, CouldNotChangeGlobalDefaultReceiveBufferSize)?;
instance_set_value(proc_path, ControlMessageBufferSizeInBytes::set_global_maximum, self.global_maximum_control_message_buffer_size_in_bytes, CouldNotChangeGlobalMaximumControlMessageBufferSize)?;
set_value(proc_path, set_auto_corking, self.socket_adjust_auto_corking, CouldNotChangeAutoCorking)?;
Ok(())
}
}