Inheritance: TCPSocket
Esempio n. 1
0
        public static TCPServer/*!*/ Reinitialize(ConversionStorage<MutableString>/*!*/ stringCast, ConversionStorage<int>/*!*/ fixnumCast,
            TCPServer/*!*/ self,
            [DefaultProtocol]MutableString remoteHost, object remotePort,
            [DefaultProtocol]MutableString localHost, object localPort) {

            self.Socket = CreateSocket(remoteHost, ConvertToPortNum(stringCast, fixnumCast, remotePort));
            BindLocalEndPoint(self, localHost, ConvertToPortNum(stringCast, fixnumCast, localPort));
            return self;
        }
Esempio n. 2
0
 public static TCPSocket AcceptNonBlocking(RubyContext/*!*/ context, TCPServer/*!*/ self)
 {
     bool blocking = self.Socket.Blocking;
     try {
         self.Socket.Blocking = false;
         return Accept(context, self);
     } finally {
         // Reset the blocking
         self.Socket.Blocking = blocking;
     }
 }
Esempio n. 3
0
        public static TCPServer/*!*/ Reinitialize(ConversionStorage<MutableString>/*!*/ stringCast, ConversionStorage<int>/*!*/ fixnumCast,
            TCPServer/*!*/ self, [DefaultProtocol]MutableString remoteHost, object remotePort, [Optional]int localPort) {

            // Not sure what the semantics should be in this case but we make sure not to blow up.
            // Real-world code (Server.connect_to in memcache.rb in the memcache-client gem) does do "TCPSocket.new(host, port, 0)"
            if (localPort != 0) {
                throw new NotImplementedError();
            }

            self.Socket = CreateSocket(remoteHost, ConvertToPortNum(stringCast, fixnumCast, remotePort));
            return self;
        }
Esempio n. 4
0
 public static void Listen(TCPServer/*!*/ self, int backlog) {
     self.Socket.Listen(backlog);
 }
Esempio n. 5
0
 public static int SysAccept(RubyContext/*!*/ context, TCPServer/*!*/ self) {
     return Accept(context, self).FileDescriptor;
 }
Esempio n. 6
0
 public static TCPSocket/*!*/ Accept(RubyContext/*!*/ context, TCPServer/*!*/ self) {
     return new TCPSocket(context, self.Accept());
 }
Esempio n. 7
0
 public static TCPServer/*!*/ Reinitialize(ConversionStorage<MutableString>/*!*/ stringCast, ConversionStorage<int>/*!*/ fixnumCast,
     TCPServer/*!*/ self, [DefaultProtocol]MutableString hostname, [DefaultParameterValue(null)]object port) {
     self.Socket = CreateSocket(stringCast, fixnumCast, hostname, port);
     return self;
 }
Esempio n. 8
0
 public static void Listen(TCPServer /*!*/ self, int backlog)
 {
     self.Socket.Listen(backlog);
 }
Esempio n. 9
0
 public static int SysAccept(RubyContext /*!*/ context, TCPServer /*!*/ self)
 {
     return(Accept(context, self).FileDescriptor);
 }
Esempio n. 10
0
 public static TCPSocket /*!*/ Accept(RubyContext /*!*/ context, TCPServer /*!*/ self)
 {
     return(new TCPSocket(context, self.Accept()));
 }
Esempio n. 11
0
 public static TCPServer /*!*/ Reinitialize(ConversionStorage <MutableString> /*!*/ stringCast, ConversionStorage <int> /*!*/ fixnumCast,
                                            TCPServer /*!*/ self, [DefaultProtocol] MutableString hostname, [DefaultParameterValue(null)] object port)
 {
     self.Socket = CreateSocket(stringCast, fixnumCast, hostname, port);
     return(self);
 }