|
|
EsUU - ActiveX control(info@eurosource.se) (http://www.eurosource.se) Updated: 1999-01-10 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
Installation
Transfer EsSock32.OCX to your \windows\system or \winnt35\system32 directory and register it by executing the command: RegSvr32 \Windows\System\EsSock32.OCXRegSvr32.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 MFC40DLL.ZIP. Regsvr32.exe is also included in this archive. If you want to check if you already got the files in mfc40dll.zip they are
Cookbook or how to use the EsSock ControlThe way to work with it
PropertiesString AddressThis 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". short ErrorNoRead only. When an error is encountered you find a code describing the error here. Possible errors-codes are:
Short PortPortnumber 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. long TimeoutThis is a time-out used for certain internal calls in EsSock. short TypeThis is an enumerated property that is capable of holding two values. Stream (=1) or Datagram (=2). MethodsBOOL Connect()Use this method to connect to a service on a remote host. Before you use the method you have to set the Address, Port and possibly also the type property. 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. BOOL Disconnect( )Disconnects from a remote host. Returns TRUE if everything OK and you are disconnected from the host.. short Read(LPTSTR buf)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. BSTR ReadString()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. BOOL Send( LPCTSTR buf, short count )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. BSTR SendCommand( LPCTSTR cmd )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. BOOL SendString( LPCTSTR str )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. EventsThere 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 sales@eurosource.se 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. SupportYou can get support by sending email to support@eurosource.se. You can also find relevant information on-line at http://www.eurosource.se 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
|