title: What's the difference between socket and HANDLE in Windows?
body: <p>I'm trying to make a Linux server running in Windows.</p>
  
  <p>Socket and file descriptor are treated the same in Linux.
  Some system api are avaliable for both socket and file descriptor.</p>
  
  <p>However, I deal with socket by Winsock and HANDLE(file descriptor) by WIN API.</p>
  
  <p>So I need to know an integer is a socket or a HANDLE.</p>
  
  <blockquote>
    <p>Now here is the question:</p>
    
    <p>Would the return value from socket()
    and open() be the same in Windows?</p>
  </blockquote>
  
  <p>If they are always different, I can write my own socket() and open() to wrap system's one.
  and record the return value from system's api whether the integer is a socket or HANDLE.</p>
  
  <p>If they will be the same, I have no idea to deal with it.</p>