Example #1
0
 private void EnsureDynamicWinsockMethods()
 {
     if (_dynamicWinsockMethods == null)
     {
         _dynamicWinsockMethods = DynamicWinsockMethods.GetMethods(_addressFamily, _socketType, _protocolType);
     }
 }
Example #2
0
 public static DynamicWinsockMethods GetMethods(AddressFamily addressFamily, SocketType socketType, ProtocolType protocolType)
 {
     lock (s_MethodTable)
     {
         DynamicWinsockMethods methods;
         for (int i = 0; i < s_MethodTable.Count; i++)
         {
             methods = s_MethodTable[i];
             if (((methods.addressFamily == addressFamily) && (methods.socketType == socketType)) && (methods.protocolType == protocolType))
             {
                 return(methods);
             }
         }
         methods = new DynamicWinsockMethods(addressFamily, socketType, protocolType);
         s_MethodTable.Add(methods);
         return(methods);
     }
 }