home *** CD-ROM | disk | FTP | other *** search
- Rem WINSOCK.VB--definitions to be used with the WINSOCK.DLL
- Rem
- Rem This header file corresponds to version 1.1 of the Windows Sockets
- Rem specification.
- Rem
- Rem Change log:
- Rem
- Rem Thu May 27 16:34:01 EDT 1993 Thomas B. Clark III (tclark@med.unc.edu)
- Rem Created Visual Basic version of WINSOCK.H.
- Rem
- Rem Thu May 27 16:35:36 EDT 1993 Mark Towfiq (towfiq@Microdyne.COM)
- Rem Added comment header, change log, etc.
- Rem
-
- Rem
- Rem The new type to be used in all
- Rem instances which refer to sockets.
- Rem
- Global sockettype As Integer
- Global Const FD_SETSIZE = 64
-
- Type fd_set_type
- fd_count As Integer
- fd_array(FD_SETSIZE) As Integer
- End Type
- Global FD_SET As fd_set_type
-
- Declare Function FD_ISSET Lib "winsock.dll" Alias "__WSAFDIsSet" (ByVal s As Integer, passed_set As fd_set_type) As Integer
-
- Rem
- Rem Structure used in select() call, taken from the BSD file sys/time.h.
- Rem
- Type timeval
- tv_sec As Long
- tv_usec As Long
- End Type
-
- Type sockaddr_in
- sin_family As Integer
- sin_port As Integer
- sin_addr As Long
- sin_zero(7) As String * 1
- End Type
-
- Type in_addr
- temp As Long
- End Type
-
- Type sockaddr
- sa_family As Integer
- sa_data(14) As Integer
- End Type
-
- Global Const WSADESCRIPTION_LEN = 256
- Global Const WSASYS_STATUS_LEN = 128
-
- Type WSAdata_type
- wVersion As Integer
- wHighVersion As Integer
- szDescription As String * 257
- szSystemStatus As String * 129
- iMaxSockets As Integer
- iMaxUdpDg As Integer
- lpVendorInfo As String * 200
- End Type
-
- Global WSAdata As WSAdata_type
-
-
- Type sockproto
- sp_family As Integer
- sp_protocol As Integer
- End Type
-
- Type linger
- l_onoff As Integer
- l_linger As Integer
- End Type
-
- Rem Socket function prototypes
- Declare Function bind Lib "winsock.dll" (ByVal s As Integer, addr As sockaddr_in, ByVal namelen As Integer) As Integer
- Declare Function htonl Lib "winsock.dll" (ByVal a As Long) As Long
- Declare Function inet_addr Lib "winsock.dll" (ByVal s As String) As Long
- Declare Function inet_ntoa Lib "winsock.dll" (ByVal in As Long) As Long
- Declare Function ntohl Lib "winsock.dll" (ByVal a As Long) As Long
- Declare Function socket Lib "winsock.dll" (ByVal af As Integer, ByVal typesock As Integer, ByVal protocol As Integer) As Integer
- Declare Function htons Lib "winsock.dll" (ByVal a As Integer) As Integer
- Declare Function ntohs Lib "winsock.dll" (ByVal a As Integer) As Integer
- Declare Function connect Lib "winsock.dll" (ByVal sock As Integer, sockstruct As sockaddr_in, ByVal structlen As Integer) As Integer
- Declare Function send Lib "winsock.dll" (ByVal sock As Integer, ByVal msg As String, ByVal msglen As Integer, ByVal flag As Integer) As Integer
- Declare Function recv Lib "winsock.dll" (ByVal sock As Integer, ByVal msg As String, ByVal msglen As Integer, ByVal flag As Integer) As Integer
-
- Rem Microsoft Windows Extension function prototypes
-
- Declare Function WSAStartup Lib "winsock.dll" (ByVal a As Integer, b As WSAdata_type) As Integer
- Declare Function WSACleanup Lib "winsock.dll" () As Integer
-
- Rem WINSOCK constants
-
- Global Const SOCK_STREAM = 1
- Global Const AF_INET = 2
-
-
-