home *** CD-ROM | disk | FTP | other *** search
/ Internet Standards / CD1.mdf / winsock / winsock.vb < prev    next >
Text File  |  1993-05-26  |  3KB  |  104 lines

  1. Rem   WINSOCK.VB--definitions to be used with the WINSOCK.DLL
  2. Rem  
  3. Rem   This header file corresponds to version 1.1 of the Windows Sockets
  4. Rem   specification.
  5. Rem  
  6. Rem   Change log:
  7. Rem  
  8. Rem   Thu May 27 16:34:01 EDT 1993 Thomas B. Clark III (tclark@med.unc.edu)
  9. Rem      Created Visual Basic version of WINSOCK.H.
  10. Rem  
  11. Rem   Thu May 27 16:35:36 EDT 1993 Mark Towfiq (towfiq@Microdyne.COM)
  12. Rem      Added comment header, change log, etc.
  13. Rem  
  14.  
  15. Rem
  16. Rem   The new type to be used in all
  17. Rem   instances which refer to sockets.
  18. Rem
  19. Global sockettype As Integer
  20. Global Const FD_SETSIZE = 64
  21.  
  22. Type fd_set_type
  23.   fd_count As Integer
  24.   fd_array(FD_SETSIZE) As Integer
  25. End Type
  26. Global FD_SET As fd_set_type
  27.  
  28. Declare Function FD_ISSET Lib "winsock.dll" Alias "__WSAFDIsSet" (ByVal s As Integer, passed_set As fd_set_type) As Integer
  29.  
  30. Rem  
  31. Rem   Structure used in select() call, taken from the BSD file sys/time.h.
  32. Rem
  33. Type timeval
  34.   tv_sec As Long
  35.   tv_usec As Long
  36. End Type
  37.  
  38. Type sockaddr_in
  39.   sin_family As Integer
  40.   sin_port As Integer
  41.   sin_addr As Long
  42.   sin_zero(7) As String * 1
  43. End Type
  44.  
  45. Type in_addr
  46.  temp As Long
  47. End Type
  48.  
  49. Type sockaddr
  50.   sa_family As Integer
  51.   sa_data(14) As Integer
  52. End Type
  53.  
  54. Global Const WSADESCRIPTION_LEN = 256
  55. Global Const WSASYS_STATUS_LEN = 128
  56.  
  57. Type WSAdata_type
  58.    wVersion As Integer
  59.    wHighVersion As Integer
  60.    szDescription As String * 257
  61.    szSystemStatus As String * 129
  62.    iMaxSockets As Integer
  63.    iMaxUdpDg As Integer
  64.    lpVendorInfo As String * 200
  65. End Type
  66.  
  67. Global WSAdata As WSAdata_type
  68.  
  69.  
  70. Type sockproto
  71.   sp_family As Integer
  72.   sp_protocol As Integer
  73. End Type
  74.  
  75. Type linger
  76.   l_onoff As Integer
  77.   l_linger As Integer
  78. End Type
  79.  
  80. Rem   Socket function prototypes
  81. Declare Function bind Lib "winsock.dll" (ByVal s As Integer, addr As sockaddr_in, ByVal namelen As Integer) As Integer
  82. Declare Function htonl Lib "winsock.dll" (ByVal a As Long) As Long
  83. Declare Function inet_addr Lib "winsock.dll" (ByVal s As String) As Long
  84. Declare Function inet_ntoa Lib "winsock.dll" (ByVal in As Long) As Long
  85. Declare Function ntohl Lib "winsock.dll" (ByVal a As Long) As Long
  86. Declare Function socket Lib "winsock.dll" (ByVal af As Integer, ByVal typesock As Integer, ByVal protocol As Integer) As Integer
  87. Declare Function htons Lib "winsock.dll" (ByVal a As Integer) As Integer
  88. Declare Function ntohs Lib "winsock.dll" (ByVal a As Integer) As Integer
  89. Declare Function connect Lib "winsock.dll" (ByVal sock As Integer, sockstruct As sockaddr_in, ByVal structlen As Integer) As Integer
  90. Declare Function send Lib "winsock.dll" (ByVal sock As Integer, ByVal msg As String, ByVal msglen As Integer, ByVal flag As Integer) As Integer
  91. Declare Function recv Lib "winsock.dll" (ByVal sock As Integer, ByVal msg As String, ByVal msglen As Integer, ByVal flag As Integer) As Integer
  92.  
  93. Rem   Microsoft Windows Extension function prototypes
  94.  
  95. Declare Function WSAStartup Lib "winsock.dll" (ByVal a As Integer, b As WSAdata_type) As Integer
  96. Declare Function WSACleanup Lib "winsock.dll" () As Integer
  97.  
  98. Rem   WINSOCK constants
  99.  
  100. Global Const SOCK_STREAM = 1
  101. Global Const AF_INET = 2
  102.  
  103.  
  104.