Exemplo n.º 1
0
 private static void ReceiveFrom(IntPtr info)
 {
     InternalReceive(info, true, (callmode, socket, data, buffer, ofs, count, flags, remoteep) =>
     {
         EndPoint endpoint = new IPEndPoint(IPAddress.Any, 0);
         int len           = 0;
         bool success      = false;
         if (callmode == 0)
         {
             success = SocketExtension.ReceiveForm(socket, buffer, 0, count, flags, ref endpoint, out len);
         }
         else if (callmode == 1)
         {
             if ((success = SocketExtension.ReceiveForm(socket, buffer, ofs, count, flags, ref endpoint, out len)))
             {
                 for (int i = ofs; i < len; i++)
                 {
                     data[i] = buffer[i];
                 }
             }
         }
         else
         {
             throw new NotSupportedException("callmode");
         }
         if (success)
         {
             ObjectAuxiliary.Fill(ObjectAuxiliary.ToObject(remoteep.VirtualMachine, endpoint), remoteep);
         }
         return(len);
     });
 }
Exemplo n.º 2
0
 private static void Headers(IntPtr info)
 {
     ObjectAuxiliary.GetOrSetProperty <HTTPResponse>(info, (response, arguments) => arguments.SetReturnValue(ObjectAuxiliary.
                                                                                                             ToObject(arguments.VirtualMachine, response.Headers)),
                                                     (response, arguments, objecttive) => ObjectAuxiliary.Fill(objecttive, response.Headers));
 }