public static int Connect(ConversionStorage<MutableString>/*!*/ stringCast, ConversionStorage<int>/*!*/ fixnumCast, RubyContext/*!*/ context, UDPSocket/*!*/ self, object hostname, object port) { string strHostname = ConvertToHostString(stringCast, context, hostname); int iPort = ConvertToPortNum(stringCast, fixnumCast, context, port); self.Socket.Connect(strHostname, iPort); return 0; }
public static int Bind(RubyContext/*!*/ context, UDPSocket/*!*/ self, object hostname, object port) { int iPort = ConvertToPortNum(context, port); if (hostname == null) { hostname = MutableString.Create("localhost"); } MutableString address = GetAddressInternal(context, hostname); IPEndPoint ep = new IPEndPoint(IPAddress.Parse(address.ConvertToString()), iPort); self.Socket.Bind(ep); return 0; }
public static int Bind(ConversionStorage<MutableString>/*!*/ stringCast, ConversionStorage<int>/*!*/ fixnumCast, RubyContext/*!*/ context, UDPSocket/*!*/ self, object hostNameOrAddress, object port) { int iPort = ConvertToPortNum(stringCast, fixnumCast, context, port); IPAddress address = (hostNameOrAddress != null) ? GetHostAddress(ConvertToHostString(stringCast, context, hostNameOrAddress)) : IPAddress.Loopback; IPEndPoint ep = new IPEndPoint(address, iPort); self.Socket.Bind(ep); return 0; }
public static UDPSocket/*!*/ Reinitialize(ConversionStorage<MutableString>/*!*/ stringCast, ConversionStorage<int>/*!*/ fixnumCast, UDPSocket/*!*/ self, [DefaultParameterValue(null)]object family) { self.Socket = CreateSocket(ConvertToAddressFamily(stringCast, fixnumCast, family)); return self; }
public static int Connect(RubyContext/*!*/ context, UDPSocket/*!*/ self, object hostname, object port) { MutableString strHostname = ConvertToHostString(context, hostname); int iPort = ConvertToPortNum(context, port); self.Socket.Connect(strHostname.ConvertToString(), iPort); return 0; }
public static UDPSocket /*!*/ Reinitialize(ConversionStorage <MutableString> /*!*/ stringCast, ConversionStorage <int> /*!*/ fixnumCast, UDPSocket /*!*/ self, [DefaultParameterValue(null)] object family) { self.Socket = CreateSocket(ConvertToAddressFamily(stringCast, fixnumCast, family)); return(self); }