                  SocketWrench Frequently Asked Questions

    This document will provide answers to those questions most frequently
    asked by those developers who are using SocketWrench or are
    interested in writing programs using the Windows Sockets API.

    For specific information about control properties and events, please
    refer to the documentation and help files included with SocketWrench.

    This FAQ is broken into several sections:

    I.   General Information
    II.  Installation
    III. Licensing
    IV.  Development

I.  General Information

1.  What exactly is SocketWrench

    SocketWrench is a custom control which uses the Windows Sockets
    API to provide basic TCP/IP networking functionality to your
    application. Both client and server capability is provided through
    the control, as well as support for both TCP and UDP protocols.
    Virtually any type of application which needs to communicate with
    another, either on a local network or over the Internet, can be
    written using SocketWrench.

2.  What platforms can SocketWrench be used on?

    SocketWrench can be used on both 16-bit platforms, such as Windows
    for Workgroups 3.11, and 32-bit platforms such as Windows 95
    and Windows NT. If you are developing or distributing your
    software on a 16-bit platform you must have TCP/IP software
    which provides a Windows Sockets 1.1 compliant library. If you
    are developing under Windows 95 or Windows NT, this software is
    included as part of the operating system.

    Note that if you are developing under Windows NT 3.51, it is
    required that you have Service Pack 5 installed. If you are
    developing under Windows NT 4.0, you must have Service Pack 3
    installed. If you are developing under Windows 95, it is
    recommended that you install the OSR1 update. These updates
    can be downloaded from the Microsoft website, or ordered
    from Microsoft on CD-ROM.
    
3.  Can SocketWrench be used with 32-bit development tools such
    as Visual Basic 5.0?

    Yes. The SocketWrench package actually contains three separate
    controls: a 16-bit Visual Basic control for earlier versions of
    Visual Basic, a 16-bit ActiveX control and a 32-bit ActiveX
    control which can be used with any development language or
    scripting tool which can act as an ActiveX container. The ActiveX
    controls can even be used as simple automation servers if the
    language supports early binding, like Visual Basic.

4.  What is the difference between SocketWrench and other commercial
    or shareware controls that are available?

    SocketWrench is a complete, fully functional control that supports
    the complete Windows Sockets API. Unlike many other controls that
    break functionality into several components (such as one control
    for TCP, another for UDP and yet another for server functionality)
    SocketWrench provides everything that you need in one control.

    Another significant difference is that SocketWrench is free.
    There are no licensing or runtime fees, and the control can be
    used to develop any type of package (commercial, in-house, shareware
    or freeware). Refer to the licensing agreement included with
    the package for all of the details.

5.  Why was SocketWrench made freely available?

    We decided to make SocketWrench freely available to developers in
    order to introduce them to our company and contribute something
    to the community of developers that we serve. SocketWrench
    developers also provide us with critical feedback on the features
    and functionality of the control. This is important not only for
    SocketWrench, but also for our commercial product, SocketTools,
    which shares many of it's features.

6.  If SocketWrench is free, why is there a registration form?

    Even though we are making SocketWrench freely available, we would
    still like to hear from those developers who are using it. The
    registration form lets us know who you are, what platforms you're
    using SocketWrench on, and what you think about the product. It
    also gives us an opportunity to let you know when other Catalyst
    products are available that you might be interested in.

7.  What is SocketTools?

    SocketTools consists of two Editions, the Visual Edition and
    the Library Edition. The Visual Edition, which includes the
    SocketWrench control, is a collection of Visual Basic and ActiveX
    controls for developers who need higher-level access to specific
    application protocols. Included in the package are controls
    for file transfer, remote login and terminal emulation, sending
    and receiving electronic mail, accessing USENET newsgroups and
    the World Wide Web. There are a total of nineteen controls in
    the Visual Edition.

    The Library Edition is a collection of dynamic-link libraries
    for developers who don't want to implement TCP/IP application
    protocols from scratch, but also don't want the overhead of
    using an ActiveX control. The Library Edition can be used by
    any Windows software development language or scripting tool,
    and libraries are included for both 16-bit and 32-bit platforms.

8.  Can I download an evaluation copy of SocketTools?

    Yes, evaluation copies for both the Visual and Library Editions
    are available for download from the Catalyst website:

        http://www.catalyst.com/products.html

    The evaluation package is fully functional and can be used for
    a period of thirty (30) days from the date of installation.

9.  What is the current version of SocketWrench and where can I
    download the product?

    The current version of the control is 2.2, and is available at
    a number of software distribution sites such as SimTel and WinSite.
    You can always find the latest version of the package on the
    Catalyst website at http://www.catalyst.com/

10. I want to use SocketWrench in my application, but my employer
    feels uncomfortable with me using free software.

    Keep in mind that SocketWrench is part of the commercial
    SocketTools package and is fully supported by Catalyst. We also
    sell source licenses to qualified organizations. Contact our
    business office for further information on source licensing.

11. If I have a problem or question, what is the best way to contact
    you?

    The best way to contact Catalyst is via email. If you have a
    product-related question, send it to info@socket-wrench.com.

    Although SocketWrench is being distributed as free software,
    Catalyst will provide email support to developers. If you
    encounter a problem, either with the control itself, or with
    the documentation, please document the error and send an
    email message to support@socket-wrench.com

II. Installation

1.  Is the SocketWrench package that you download available as
    self-extracting executables or as ZIP files?

    Both formats are available. If you download a self-extracting
    executable, all you need to do to begin the installation is
    run the file (either by clicking on the icon in Explorer, or
    by selecting Start...Run and entering the filename). If you
    download the package as a ZIP file, you will need a program such
    as WinZip to extract the contents of the file. Once you have
    extracted all of the files, you can run the SETUP.EXE program
    to begin the installation.

2.  I have downloaded SocketWrench, and when I attempt to begin the
    installation, I get an error message.

    The file may have been corrupted during the file transfer. If
    you are using FTP to download the files, make sure that the
    client software is in "binary" mode. Many applications default
    to "text" mode, which will corrupt the file and make it unusable.

3.  The installation begins, but then I get an error message that
    I have to insert a disk.

    Before you begin the installation, make sure that you have at
    least 20 MB of available disk space. If you have a temporary
    directory (specified by the TEMP environment variable), try
    removing all files and subdirectories from that directory and
    restarting the installation. If you continue to have a problem
    and downloaded the self-extracting executable, try downloading
    the ZIP file and extracting the contents into an empty directory,
    running the SETUP.EXE program from there.

4.  During installation, a general protection fault (access violation)
    occurs and the setup terminates.

    This is an error in the InstallShield setup program used to
    install SocketWrench. Take the following steps and then attempt
    the installation again:

    1. Run ScanDisk on the system drive (the drive that contains
       the Windows operating system) and the drive that you are
       attempting to install SocketTools on. If there were errors
       during the scan, repair them, reboot the system and continue.
      
    2. Check the TEMP environment variable to make sure that it
       specifies a valid temporary directory; this directory should
       not be the directory where Windows is installed. Under
       Windows 95, this environment variable would be set in the
       AUTOEXEC.BAT file. Under Windows NT, it would be set through
       the System icon on the control panel.

    3. Make sure that you have enough free disk space to perform
       the installation (it is recommended that you have at least
       20 megabytes free during the installation process). This free
       space must be available on the drive that contains the
       specified temporary directory, as well as the drive that
       will contain the installed files.

    4. Erase all files (including any hidden or read-only files) and
       sub-directories from the temporary directory.

    5. If installing on Windows NT, make sure that the account that
       you are installing SocketTools with has Administrator
       privileges.

    6. Make sure that no other programs, such as the Microsoft Office
       FindFast utility, are not running at the time of installation.
       If you have a utility that monitors installations, such as
       CleanSweep, disable that utility.

    7. Shutdown the system and perform a cold reboot (turn the power
       off, wait 10 seconds and then turn the power back on).

    If you continue to have problems with the installation, send email
    to socketwrench@catalyst.com describing the problem and your system
    configuration (including operating system version, memory and
    available diskspace).

5.  During installation a message is displayed that states that
    one or more components could not be installed or registered.

    The setup program may be unable to update or register one of
    the SocketWrench components or support libraries because an
    outdated module is currently in use by the system. Restart the
    system, and before beginning the installation, make sure that
    no other programs are running in the background.

III. Licensing

1.  Can I use SocketWrench to create a commercial application?

    Yes. There is no restriction on commercial distribution of
    an application created with SocketWrench. You are also allowed
    to create "freeware" and "shareware" applications. We do,
    however, require that you copyright your software. The section
    on distribution in the License Agreement discusses the
    requirements.

2.  Do I have to include your copyright message in my software?

    No. All that we require is that you place your own copyright
    notice on the software that you distribute which uses the
    SocketWrench control. If you would like to acknowledge the
    use of SocketWrench in your product, you can use something
    like this in your About dialog or documentation:

        Portions copyright Catalyst Development Corp.

    We certainly appreciate your attribution and would be interested
    in hearing about your software. You can send an email to us at
    info@socket-wrench.com to let us know how you're using SocketWrench!

3.  Can I use SocketWrench to build a software development tool?

    No. A number of development tools (such as Visual Basic) allow you
    to create COM/ActiveX objects based on other controls. Creating
    reusable objects for internal use by an application is allowable.
    However, creating a reusable object that is itself a product
    violates the terms of the license agreement.

4.  I would like to make the SocketWrench package available for
    download from my website. Can I do this?

    Yes. All that we require is that you redistribute the package
    unmodified, complete with all of the files, and that you do not
    charge a fee for the software.

5.  I would like to include the SocketWrench package on a CD-ROM
    that includes other software. Is this allowed?

    Yes. As with electronic distribution, we require that you
    redistribute the package unmodified, complete with all of the
    files. Since you are distributing the software on physical
    media, the license agreement does allow for reasonable media
    and shipping charges.

    As with most restrictions like this, "reasonable" is largely
    in the eyes of the beholder. Our intent is that the person who
    purchases your CD-ROM understands that they are paying for the
    convenience of the software collection on the CD, and not the
    software itself.

IV. DEVELOPMENT QUESTIONS

1.  I'm not very familiar with TCP/IP and sockets programming. How
    do you recommend I get started?

    Included with SocketWrench is a User's Guide and Technical
    Reference in Microsoft Word format. This document covers
    the basics of TCP/IP programming with SocketWrench and gets
    you started with your first project. There are also a number
    of samples included with the package which demonstrate how to
    use the control with a variety of application protocols.

2.  I'm familiar with sockets programming under UNIX, and need to
    write some client applications for Windows. Will your product
    work for me?

    Absolutely. If you're familiar with sockets programming under
    UNIX, you should find the control particularly easy to work
    with in creating your client applications with SocketWrench.

3.  I want to use SocketWrench to develop a program which uses a
    specific application protocol. How do I do that?

    The best resource for learning about the common application
    protocols are RFC's. These Request For Comment documents form
    the foundation of the application protocols used over the
    Internet. There are a great number of them, but some of the
    more common ones are:

    RFC 821    Simple Mail Transfer Protocol (SMTP)
    RFC 959    File Transfer Protocol (FTP)
    RFC 977    Network News Transfer Protocol (NNTP)
    RFC 1341   Multipurpose Internet Mail Extensions (MIME)
    RFC 1436   Internet Gopher Protocol
    RFC 1459   Internet Relay Chat Protocol (IRC)
    RFC 1725   Post Office Protocol Version 3 (POP3)

    You can find a complete list of RFC's and other standards documents
    at http://ds.internic.net/ in the Directory and Database Services
    section.

4.  When I try to include SocketWrench in my project, I get an error
    message stating that it cannot load the control.

    This error can be generated when attempting to load a project that
    uses a 16-bit control with a 32-bit development tool, such as Visual
    Basic 5.0. If the project uses a Visual Basic control, it must be
    changed to use the ActiveX equivalent, and the 32-bit version of
    that control must be installed and registered on the system.

    Also check to make sure that the control is installed in the system
    directory (under Windows NT, the 32-bit ActiveX control should be
    installed in the system32 directory). If you are attempting to
    use the SocketWrench ActiveX control, it may need to be registered
    again. For the 16-bit control, you should enter the following
    command at a command prompt:

        regsvr cswsk16.ocx

    If you are trying to use the 32-bit control, then you should
    enter the following command:

        regsvr32 cswsk32.ocx

    These utilities load the control and cause them to "register"
    themselves. Registration is a process where the control stores
    information about itself in the system registry. If this information
    is not present, development tools will be unable to load the
    controls. Note that this only applies to ActiveX (OCX) controls,
    not Visual Basic (VBX) controls.

5.  None of the Catalyst controls are listed when selecting custom
    controls in Visual Basic 4.0 or 5.0.

    On the Custom Controls dialog box, there is a checkbox called
    "Selected Items Only". Make sure that this is unchecked. Under
    Visual Basic 4.0, also make sure that the "Controls" box is checked.
    If the controls are still not displayed, this indicates that they
    were not registered on the system. Note that you cannot copy
    ActiveX controls from one system to another and use them like Visual
    Basic controls. You must register them using the regsvr.exe or
    regsvr32.exe utilities.

6.  The error "Can't load (or register) custom control" is reported
    when attempting to use one of the controls.

    This typically indicates a problem with a missing or outdated
    support DLL used by the control. With the 32-bit version of the control,
    the following files are required:

         File            Version
         -----------     -------------
         MSVCRT.DLL      5.00.7022
         MFC42.DLL       4.21.7022
         OLEAUT32.DLL    2.20.4118
         OLEPRO32.DLL    5.0.4118

    If these files are present, you may have an older version of one of
    the libraries which will prevent the control from loading. You should
    install the same version that is distributed with the SocketTools
    controls. Note that the MFC42.DLL library is self-registering, which
    means that you should use the regsvr32.exe utility to register it. For
    example, under Windows 95, you would enter:

        regsvr32 c:\windows\system\mfc42.dll

    For the 16-bit controls, the following libraries are required:

         File            Version
         -----------     -------------
         OC25.DLL        2.53
         MFC250.DLL      2.5.200b

    The OC25.DLL is also self-registering, which means that you should
    use the 16-bit registration utility regsvr.exe to register the library.
    For example, you would enter:

        regsvr c:\windows\system\oc25.dll

    The regsvr and regsvr32 utilities can also be used to individually
    register ActiveX controls. Simply specify the control name as a
    command argument. A message box will be displayed, indicating if it
    was able to register the control or not. Keep in mind that the 16-bit
    registration utility can only be used to register 16-bit controls,
    while the 32-bit version can only be used to register 32-bit controls.

7.  When I place the control on a form, I get a general protection
    fault (GPF) right away or shortly afterwards. Why?

    This is typically a problem on 16-bit platforms that have more
    than one copy of a Windows Sockets library installed on the system.
    Because Windows searches the directories specified by the PATH
    environment variable, in some cases the incorrect library version
    or vendor software is loaded. You can use the WPS utility (included
    with the Visual Basic 3.0 Professional Edition or downloadable
    from the Microsoft FTP site) to determine where the Windows Sockets
    module is being loaded from.
   
8.  Do I have to be connected to the Internet when I develop my
    application?

    The SocketWrench control will dynamically load the Windows Sockets
    library only when it determines that it actually needs a network
    connection. This means that it is safe to use the control in a
    project, and as long as it is not accessed, it will not require
    a network connection.

    When you come to the point in your development where you want to
    work with the control, but you don't want to dial out to a service
    provider, you can use what is called the "loopback" interface. This
    is a special IP address, 127.0.0.1, which always refers to your
    own local system. Just like a loopback connector on a serial port,
    when you use this address, anything that is written on the socket
    is immediately sent back as data to be read (in other words, it
    "loops" back to you).

9.  Why doesn't my 16-bit program automatically bring up the dialer
    under Windows 95 or NT?

    Because your program is using the 16-bit control, it is loading
    the 16-bit Windows Sockets library. For reasons known only to
    Microsoft, they decided that only 32-bit applications would be
    able to automatically invoke the dialer.

10. How do I establish a connection to my Internet service provider
    with my program?

    Dial-up networking is part of the Remote Access Services (RAS)
    subsystem which can be used by both 16-bit and 32-bit programs.
    Included with SocketWrench is the SocketTools Dialer control
    which will allow you to manage remote dial-up networking
    connections under Windows 95 and Windows NT. Both 16-bit and
    32-bit versions of the controls are included.

11. Can I use the Dialer control on a Windows for Workgroups system?

    Unfortunately, Windows for Workgroups only supports the NetBEUI
    protocol with dial-up network connections. This means that although
    you could use the control to establish a connection, you could
    not use it to facilitate a connection to the Internet. The Dialer
    is only supported under the Windows 95 and Windows NT platforms.

12. I get an error in Visual C++ 1.5 when using the SocketWrench VBX.

    SocketWrench was developed against the Visual Basic 2.0
    control specification. Unfortunately, Visual C++ 1.5 only supports
    controls written to the 1.0 specification. You can use the 32-bit
    ActiveX control with Visual C++ 4.2 and later, however.

13. None of the VBX control's properties are visible in Delphi 1.0.

    For the same reason that the control will not work with Visual
    C++ 1.5, it will not work in Delphi because it only supports VBXs
    written to the 1.0 specification. Note that later versions of Delphi
    support ActiveX controls which can be used instead.

14. I get a GPF when using the SocketWrench VBX and Sheridan's
    VB Assist.

    SocketWrench implements some custom properties which have the
    same names as standard control properties. This is fine for
    Visual Basic, but seems to confuse VB Assist. Sheridan is
    aware of the problem, so it may have been corrected in the
    latest version of their software.

15. Why do I only get empty strings when I read the LocalName or
    LocalAddress properties?

    SocketWrench attempts to determine your local host name and
    address by first calling a function to determine your local
    name(through a call to the gethostname() function, and then
    using that name, your IP address through a call to the
    gethostbyname() function.

    Some Windows Sockets libraries, notably the one included in
    Novell's LAN Workplace product, will not return the required
    information unless the system has an entry for itself in
    the local hosts file. This problem may also occur if you have
    a dialup network connection, using DNS for name resolution,
    and your host does not have a reverse (PTR) entry in the
    DNS database.

16. How can I specify a port number greater than 32767 in
    Visual Basic?

    Specify the port number as a hexadecimal value. Although Visual
    Basic only uses signed integers, the control will handle the
    value correctly and treat it as an unsigned integer internally.

17. Why do I get strange values when I check the RecvNext property
    to determine the number of bytes available to be read from the
    socket?

    This is a problem that has been found on some Windows Sockets
    implementations where a call to the ioctlsocket() function 
    returns a wildly incorrect value. This problem typically manifests
    itself on non-blocking, unbuffered TCP sockets.

18. I am trying to write a client application, and after the first
    connection, I'm getting an error stating that the address is
    already in use.

    You're not setting the LocalPort property to IPPORT_ANY before
    you establish the connection. By default, the LocalPort property
    has a value of zero (which is the same as IPPORT_ANY). What this
    tells the socket library is that you don't care what your local
    port number is, and for the library to assign you an unused port
    number greater than 1024.
    
    After you connect to the server, the LocalPort property is modified
    to reflect the actual port number that was assigned to your socket.
    If, the next time you attempt to connect using that socket, the
    LocalPort property does not have a value of zero, it will attempt to
    use that specific port number, which may result in the error being
    generated. To correct the problem, simply insure that the LocalPort
    property has a value of zero before you attempt the connection.

19. Can SocketWrench broadcast UDP datagrams over the local network?

    Refer to the UDPECHO sample program for a generic example of using
    UDP with SocketWrench. In order to broadcast datagrams (that is,
    each machine on the local network will receive the datagram sent
    from your local host), you need to set the Broadcast property to
    True, and set the HostAddress property to the broadcast IP address
    for your network.

20. During execution of a program, error 68 (device unavailable) is
    being generated.

    This error indicates that the control could not load or initialize
    the Windows Sockets library. This could indicate that there is no
    library installed on the system, or that the directory that it was
    installed in was not included in the PATH environment variable.
    It may also reflect a configuration problem with the TCP/IP software
    itself. For example, if the network card drivers failed to load
    because of a problem with the adapter.

21. Setting the HostAddress or HostName property results in a delay,
    sometimes up to thirty seconds, before the next line of code in
    the program is executed.

    The HostAddress and HostName properties are reciprocal, which means
    that when you set one, the other is automatically updated to reflect
    the change. When the HostAddress property is set, the control will
    attempt to determine the hostname associated with that address, and
    when the HostName property is set, it will attempt to determine it's
    IP address. For those systems that use DNS, this can result in a
    delay of several seconds. If the system is connected to the Internet,
    then this delay can be noticeably longer, especially if multiple
    servers must be queried. To prevent the controls from automatically
    resolving hostnames and IP addresses, set the AutoResolve property
    to False. This will force the control to only resolve hostnames at
    the time a connection is attempted, rather than each time the property
    is set.

22. The error "out of memory" is returned whenever a large amount of
    data is written through the control using the SendData property
    or Write method.

    This error indicates that the amount of data cannot be written
    to the socket, and there is not enough buffer space allocated
    internally by the control to store it. Generally speaking, it is
    better to write large amounts of data out in small 1K to 2K blocks,
    rather than attempting to send it all at once. Even though you may
    be able to send large amounts of data over a particular network
    configuration (such as over a local network), it could cause
    problems when your application is installed in a different
    environment (such as a serial dial-up networking connection to
    the Internet).

23. Using the Visual Basic control to read or write binary data works,
    but the same program using the ActiveX control causes the data to
    be corrupted.

    The RecvData and SendData properties are used to read and write
    data using the Visual Basic controls. These same properties are
    available with the ActiveX control as well, but they cannot be
    used to read or write data which contains embedded nulls (characters
    with an ASCII value of zero). With ActiveX controls, the preferred
    method of reading or writing data is to use the Read or Write methods,
    which allow the use of strings which contain embedded nulls.

24. An error occurs when attempting to use a non-string data type when
    reading or writing on the socket.

    Only strings may be used to read and write data through the controls.
    A user-defined data structure, or non-string data type must be copied
    into a pre-allocated string that is large enough to contain the data.
    Under Visual Basic 3.0, the hmemcpy kernel function may be used, while
    the function RtlMoveMemory may be used under Visual Basic 4.0 and 5.0.
    In Visual Basic 4.0, the declaration may look like this:
    
    #If Win32 Then
    Declare Sub CopyMemory Lib "KERNEL32" Alias "RtlMoveMemory" ( _
            hpvDest As Any, hpvSource As Any, ByVal cbCopy As Long)
    #Else
    Declare Sub CopyMemory Lib "KERNEL" Alias "hmemcpy" ( _
            hpvDest As Any, hpvSource As Any, ByVal cbCopy As Long)
    #End If

    Your application can then use the function CopyMemory to copy the data
    from your user-defined data type or numeric variable into a string. For
    additional information about sending and receiving user-defined data
    structures, visit the SocketTips section of the Catalyst website at
    http://www.catalyst.com/

Copyright 1998, Catalyst Development Corporation. All rights reserved.
SocketWrench and SocketTools are trademarks of Catalyst Development Corporation
