public static MutableString GetSocketOption(ConversionStorage <int> /*!*/ conversionStorage, RubyContext /*!*/ context, RubyBasicSocket /*!*/ self, [DefaultProtocol] int level, [DefaultProtocol] int optname) { Protocols.CheckSafeLevel(context, 2, "getsockopt"); byte[] value = self.Socket.GetSocketOption((SocketOptionLevel)level, (SocketOptionName)optname, 4); return(MutableString.CreateBinary(value)); }
public static int Send(ConversionStorage <int> /*!*/ fixnumCast, RubyBasicSocket /*!*/ self, [DefaultProtocol, NotNull] MutableString /*!*/ message, object flags) { Protocols.CheckSafeLevel(fixnumCast.Context, 4, "send"); SocketFlags socketFlags = ConvertToSocketFlag(fixnumCast, flags); return(self.Socket.Send(message.ConvertToBytes(), socketFlags)); }
public static int Send(RubyContext /*!*/ context, RubyBasicSocket /*!*/ self, object message, object flags) { Protocols.CheckSafeLevel(context, 4, "send"); SocketFlags socketFlags = ConvertToSocketFlag(context, flags); MutableString strMessage = Protocols.CastToString(context, message); return(self.Socket.Send(strMessage.ConvertToBytes(), socketFlags)); }
public static void SetSocketOption(RubyContext /*!*/ context, RubyBasicSocket /*!*/ self, object /*Numeric*/ level, object /*Numeric*/ optname, bool value) { Protocols.CheckSafeLevel(context, 2, "setsockopt"); int iLevel = Protocols.CastToFixnum(context, level); int iOptname = Protocols.CastToFixnum(context, optname); self.Socket.SetSocketOption((SocketOptionLevel)iLevel, (SocketOptionName)iOptname, value); }
public static MutableString GetSocketOption(RubyContext /*!*/ context, RubyBasicSocket /*!*/ self, object /*Numeric*/ level, object /*Numeric*/ optname) { Protocols.CheckSafeLevel(context, 2, "getsockopt"); int iLevel = Protocols.CastToFixnum(context, Protocols.ConvertToInteger(context, level)); int iOptname = Protocols.CastToFixnum(context, Protocols.ConvertToInteger(context, optname)); byte[] value = self.Socket.GetSocketOption((SocketOptionLevel)iLevel, (SocketOptionName)iOptname, 4); return(MutableString.CreateBinary(value)); }
public static void SetSocketOption(RubyContext /*!*/ context, RubyBasicSocket /*!*/ self, object /*Numeric*/ level, object /*Numeric*/ optname, object value) { Protocols.CheckSafeLevel(context, 2, "setsockopt"); MutableString strValue = Protocols.CastToString(context, value); int iLevel = Protocols.CastToFixnum(context, Protocols.ConvertToInteger(context, level)); int iOptname = Protocols.CastToFixnum(context, Protocols.ConvertToInteger(context, optname)); self.Socket.SetSocketOption((SocketOptionLevel)iLevel, (SocketOptionName)iOptname, strValue.ConvertToBytes()); }
public static int Send(RubyContext /*!*/ context, RubyBasicSocket /*!*/ self, object message, object flags, object hostname, object port) { Protocols.CheckSafeLevel(context, 4, "send"); // Convert the parameters SocketFlags sFlags = ConvertToSocketFlag(context, flags); MutableString strMessage = Protocols.CastToString(context, message); MutableString address = GetAddressInternal(context, hostname); int iPort = ConvertToPortNum(context, port); EndPoint toEndPoint = new IPEndPoint(IPAddress.Parse(address.ConvertToString()), iPort); return(self.Socket.SendTo(strMessage.ConvertToBytes(), sFlags, toEndPoint)); }
public static int Send(ConversionStorage <int> /*!*/ fixnumCast, ConversionStorage <MutableString> /*!*/ stringCast, RubyBasicSocket /*!*/ self, [DefaultProtocol, NotNull] MutableString /*!*/ message, object flags, object hostNameOrAddress, object port) { Protocols.CheckSafeLevel(fixnumCast.Context, 4, "send"); int iPort = ConvertToPortNum(stringCast, fixnumCast, port); SocketFlags sFlags = ConvertToSocketFlag(fixnumCast, flags); // Convert the parameters IPAddress address = (hostNameOrAddress != null) ? GetHostAddress(ConvertToHostString(stringCast, hostNameOrAddress)) : IPAddress.Loopback; EndPoint toEndPoint = new IPEndPoint(address, iPort); return(self.Socket.SendTo(message.ConvertToBytes(), sFlags, toEndPoint)); }
public static int Send(ConversionStorage <int> /*!*/ fixnumCast, RubyBasicSocket /*!*/ self, [DefaultProtocol, NotNull] MutableString /*!*/ message, object flags, [DefaultProtocol, NotNull] MutableString /*!*/ to) { Protocols.CheckSafeLevel(fixnumCast.Context, 4, "send"); // Convert the parameters SocketFlags socketFlags = ConvertToSocketFlag(fixnumCast, flags); // Unpack the socket address information from the to parameter SocketAddress address = new SocketAddress(AddressFamily.InterNetwork); for (int i = 0; i < to.GetByteCount(); i++) { address[i] = to.GetByte(i); } EndPoint toEndPoint = self.Socket.LocalEndPoint.Create(address); return(self.Socket.SendTo(message.ConvertToBytes(), socketFlags, toEndPoint)); }
public static int Send(RubyContext /*!*/ context, RubyBasicSocket /*!*/ self, object message, object flags, object to) { Protocols.CheckSafeLevel(context, 4, "send"); // Convert the parameters SocketFlags socketFlags = ConvertToSocketFlag(context, flags); MutableString strMessage = Protocols.CastToString(context, message); MutableString strToAddress = Protocols.CastToString(context, to); // Unpack the socket address information from the to parameter SocketAddress address = new SocketAddress(AddressFamily.InterNetwork); for (int i = 0; i < strToAddress.GetByteCount(); i++) { address[i] = strToAddress.GetByte(i); } EndPoint toEndPoint = self.Socket.LocalEndPoint.Create(address); return(self.Socket.SendTo(strMessage.ConvertToBytes(), socketFlags, toEndPoint)); }
public static void SetSocketOption(RubyContext /*!*/ context, RubyBasicSocket /*!*/ self, [DefaultProtocol] int level, [DefaultProtocol] int optname, [DefaultProtocol, NotNull] MutableString /*!*/ value) { Protocols.CheckSafeLevel(context, 2, "setsockopt"); self.Socket.SetSocketOption((SocketOptionLevel)level, (SocketOptionName)optname, value.ConvertToBytes()); }
public static void SetSocketOption(ConversionStorage <int> /*!*/ conversionStorage, RubyContext /*!*/ context, RubyBasicSocket /*!*/ self, [DefaultProtocol] int level, [DefaultProtocol] int optname, bool value) { Protocols.CheckSafeLevel(context, 2, "setsockopt"); self.Socket.SetSocketOption((SocketOptionLevel)level, (SocketOptionName)optname, value); }
public static void SetDoNotReverseLookup(RubyBasicSocket /*!*/ self, bool value) { Protocols.CheckSafeLevel(self.Context, 4); self._doNotReverseLookup = value; }
public static void SetDoNotReverseLookup(RubyClass /*!*/ self, bool value) { Protocols.CheckSafeLevel(self.Context, 4); DoNotReverseLookup(self.Context).Value = value; }