EsSock - ActiveX Control
EsSock is a control that handle the client aspect of a Internet socket connection. With this control you can connect to a server over the Internet in either Stream or Datagram mode and send/receive data. The interface to the control has been kept simple so that people can program for the Internet with no or little knowledge of the underlying structures.
New features in version 1.1
1998-03-19 Build 18 - Fixed bug that caused the source port to be the same as the requested remote port.
Transfer EsSock32.OCX to your \windows\system or \winnt35\system32 directory and register it by executing the command:RegSvr32 \Windows\System\EsSock32.OCX
RegSvr32.exe can be found on the Visual Basic 4.0 CD-ROM and in our dll archive (www.eurosource.se). If RegSvr32.exe fails, it's probably because you don't have the MFC 4.0 DLL library installed on your system. This is available from many sources on the Internet including our ftp archive as MFCDLLS.ZIP. Regsvr32.exe is also included in this archive. If you want to check if you already got the files in mfcdlls.zip they are
Create a EsSock object for an ASP application
Use the object ID ESSOCK.EsSockCtrl.1 when you create an instance of
The way to work with it
This is the address of the server/host you want to connect to. You can set this value either as an IP-address in the dot notation form as in "127.64.12.1" or in the more human readable form as in "host.somewhere.com".
When an error is encountered you find a code describing the error here.
Possible errors-codes are:
Portnumber for the service you want to connect to. If you have TCP/IP installed on your computer you will find a file called services in the windows directory that contains many of the port numbers that is defined.
This is a time-out used for certain internal calls in EsSock.
This is an enumerated property that is capable of holding two values. Stream (=1) or Datagram (=2).
You use the Disconnect method to close your connection. Note that some protocols such as SMTP also requires a "quit" command.
Returns TRUE if everything OK and you are connected to the remote host's service.
Disconnects from a remote host.
Returns TRUE if everything OK and you are disconnected from the host.
With this command you can read input from an open connection into a buffer. This buffer must be capable of holding at least 512 characters. It is your responsibility to allocate this storage before you call the method.
The number of characters read are returned from the method. If this value is set to null this can indicate that there was no characters to read or that an error occurred. If this happens you should always check the ErrorNo for a possible error code.
As most protocols on the Internet work with text we recommend that you use the ReadString method instead of this one.
With this command you can read input from an open connection into a string. If an error occurs an empty string is returned and the ErrorNo property is set to the error code for the failure.
Use this method to send count characters from a buffer to the host.
TRUE is returned if everything is OK and FALSE if an error occurred. In case of error the ErrorNo property contains the error code.
This method can be used to send commands to a server and at the same time fetch the response from the server. Before the string 'cmd' is sent to the server a CRLF pair is added to the tail of the string. This is the most usual way for most Internet protocol's to work.
In case of an error an empty string is returned and you should check the property ErrorNo for the error code if this happens. If ErrorNo is set to zero the server just sent back an empty string.
With this method you can send a string to the host.
TRUE is returned if everything went well and FALSE if an error occured. In case of an error the ErrorNo property contains the error code.
There is no events defined for this component.
Where to get the control?
It is possible that you are reading this documentation without having access to the control itself. If you have Internet access you just need to connect to http://www.eurosource.se and fetch a fully working sample of the control. At this location you can also find samples on how to use the control.
We can email the control anywhere in the world if you send us a request to do so. Please state if you want MIME or BINHEX coding. Send request to email@example.com
If you use the unregistered version of the control a splash screen is displayed from time to time reminding you to register.To get rid of this nag-screen you need to register. Information is available at our site.
We ship anywhere in the world with World-wide First Class/Airmail if you select this option. The only media supported is 3.5" diskettes.The charge for this type of delivery is $15 (USD) extra.
We also check the newsgroup comp.lang.basic.visual.3rdparty on a regular basis and will try to help on all questions posted there.
How to contact us