Home | About Us | FAQ
    Products
Development
 
AZ Office:
voice (602) 750-6161
Send an e-Mail
 
   
 
Go to Download

Active Socket Object 3.5 w/ Full Unicode Support

What is Active Socket Object Component?

Active Socket Object is a fast and light weight component that will allow developers to connect to any TCP/IP port on any server, and then transfer data. Version 3.5 is fully Unicode-aware (which is a must for international market), with automatic Little/Big endian byte ordering detection and supports both endian byte ordering read and write functions. Protocols supported are TCP/IP, UDP (Datagram), RAW, RDM, SEQPACKET protocol.
This component is designed for C++, Visual Basic, ASP, Delphi, PHP, Perl, and any other component-aware environment. Many sample source codes are available.

Installation

After download ActiveSocket.zip file, use Unzip Utility such as (WinZip) to extract, and run Setup.exe

Upgrades


Upgrade is free for a minor version change. For example, upgrading from 3.50 to 3.99. However, 3.50 to 4.00 may require a small upgrade fee. (Which will be also posted)

Registration

When you purchase (or register) Active Socket Object Component, it is for a single
computer (or server) use. If you plan to use in a multiple machines,
you must purchase license separately.
The price is $45.00 for each computer.

For multiple quantities:
2 Servers: $89.00
3 Servers: $129.00
5 Servers: $204.00
Site License: $350.00 / Unlimited copy within a single location (site)
Enterprise License: $1200.00 / Unlimited within a single company / organization
Developer License: $399.00 Royalty free unlimited distribution within your product

(as long as the final product is not another socket-only product)


Upgrade Instructions

Please follow these steps to upgrade the component from a previous version

For VB, Delphi, VC++, or any other component environment
Exit the program that uses comSocket.dll, and run setup.exe or overwrite comSocket.dll

For web server use, stop all IIS related services such as FTP and W3SVC.
(See IIS documentation how to stop these services)
At DOS prompt, change to the directory where the comSocket.dll component is and type "regsvr32 /u comSocket.dll"
Move the new version of comSocket.dll to that same directory and type "regsvr32 comSocket.dll"
Restart the necessary services.

If .dll cannot be registered, you must reboot the server, in order to free the .DLL from the memory pool.


Q&A
How do I determine what caused a socket error?

If the component cannot connect to the remoteHost, it will write the reason in "err" property of the component. For example,
set s = createObject("comSocket.SocketObj")
if not s.connect("www.yahoo.com",80) then

errMsg = "Socket connected OK"
else
errMsg = "Error is " & s.err
end if

It never works. I get "Server object error xxx." or "Can't create ActiveX component"You did not register .dll component correctly on your server.

1. See Installation above. (You must run regsvr32.exe comSocket.dll on DOS prompt)

2. You moved your .DLL file after you registered it.

3. If used for ASP or inside internet environment, IIS do not have enough permission. (At least read)

4. Your server have no memory and cannot create additional object.

5. Your evaluation copy expired. If you purchased the component, just re-register the new component. (May require IIS restart)

How do I upgrade to the latest version?Just download the latest evaluation version, and follow the instruction.
Can I redistribute this control with my products?You must contact us for redistribution. The license does not include redistribution. Please contact sales@comsoltech.com for detail.

Active Socket Object Properties
Property =Read Only = Read/WriteDescription
eofReturns TRUE if readLine() failed, or there was an error condition during reading and writing. Otherwise returns FALSE.
err
error
If there is an error inside component, this contains what the error is.
isConnectedReturns true if the socket is currently connected to a remote port and false if not.
newlineNewline characters when WriteLn() is used. "\r\n" is the default value.
remotePortSets the TCP I/P remote port that the component will try to open.

Example:

set s = createObject("comSocket.SocketObj")
s.remotePort = 80

registeredToReturns the company name who licensed the product.
remoteHostThe remote host that the component will try and connect to.

Example:

set s = createObject("comSocket.SocketObj")
s.RemoteHost = "news.somehost.net"

socketTypeThis is a socket type for the connetion.
Most likely you use TYPE_TCP for TCP/IP communication, and TYPE_UDP for UDP datagram (multicast). Do not use other protocols if you are not sure.

TYPE_TCP = 1 (Default)
TYPE_UDP = 2
TYPE_RAW = 3
TYPE_RDM = 4
TYPE_SEQPACKET = 5

...
. Send TCP Packet
set s = createObject("comSocket.SocketObj")
s.socketType = s.TYPE_TCP
if( s.connect( "11.33.55.77", 80 ) ) then
...
end if
...

' Send UDP packet
...
set s = createObject("comSocket.SocketObj")
s.socketType = s.TYPE_UDP
s.connect "11.22.33.44", 1000
s.write "Testing UDP Packet"
...
timeOutTimeout (in miliseconds) is the maximum time that Active Socket Object Component should wait for a Response from the remote server. The default is 5000 miliseconds.

Example:

set s = createObject("comSocket.SocketObj")
s.Timeout = 5000

versionGets the internal component version number.

Example:

set s = createObject("comSocket.SocketObj")
versionMsg = "Version: " & s.version




Active Socket Object Methods
MethodParametersReturn ValueDescription
boolean connect(string, int)
throws com exception
N/ATrue/FalseOpens the connection to the remoteHost server using the specified remotePort.
disconnect()
throws com exception
N/AN/ACloses the socket connection.
String Read Functions
string readLine()
throws com exception
N/Astring
(BSTR in C++)
Reads a line. May timeout if the function does not return within timeOut seconds.
string readLineWithoutNewLine()
throws com exception
N/Astring
(BSTR in C++)
Reads a line, but last carriage return is chopped. i.e., "\r\n" or "\n" character is chopped off from the input.

...if input was "abc\r\n"
s.readLineWithoutNewLine()
...returns "abc"
Array readBytes(int count)
throws com exception
integer
(# of bytes to read.)
ByteArray
(SafeArray in C++)
Read x number of bytes and return as a byte array (variant). (timeouts if socket does not return within timeOut seconds)

Example (VB & ASP):

dim aryByte
aryByte = s.ReadBytes(20)
string readBytesAsString(int cnt)
throws com exception
integer
(# of bytes to read.)
StringRead x number of bytes and return as a string. (timeouts if socket does not return within timeOut seconds)

Example (VB & ASP):

dim str
str = s.ReadBytesAsString(20)

String Write Functions
boolean write(string str)stringTrue/FalseWrites the specified string out to the connection.
boolean writeBytes(Array)
throws com exception
Byte Array True/FalseWrites the string out to the connection with a newline (\r\n = vbCrLf)
boolean writeLine(string str)stringTrue/FalseWrites the string out to the connection with a newline (\r\n = vbCrLf)
Unicode Functions
(Note: Visual Basic/ASP string is Unicode by default.
In C++, BSTR type is recommended to use as Unicode characters.
Perl does not support Unicode natively yet, however, use regular character to simulate the Unicode read/write.)
setUnicodeBigEndianbooleanN/ASets read/write operation to be big endian byte order. Big endian means write the high byte first and then low byte.
For example,
"abc" is stored as
"0x40 0x00 0x41 0x00 0x42 0x00"
in intel chip-based O/S.
When setUnicodeBigEndian() is called, write operation will write
"0x00 0x40 0x00 0x41 0x00 0x42"
which bytes are swapped (High Byte first and Low Byte)

Example: (VB & ASP)
set s = createObject("comSocket.SocketObj")
s.connect ..., ...
...
s.setUnicodeBigEndian()
s.writeLineAsUnicode( "abc" )
...

This writes out six (6) bytes.
setUnicodeLittleEndian (Default) booleanN/AThis is the default mode.
Sets read/write operation to be little endian byte order. Big endian means write the low byte first and then high byte.
For example,
"abc" is stored as
"0x40 0x00 0x41 0x00 0x42 0x00"
in intel chip-based O/S.
When setUnicodeLittleEndian() is called, write operation will write exactly as stored:

"0x40 0x00 0x41 0x00 0x42 0x00"

Example: (VB & ASP)
set s = createObject("comSocket.SocketObj")
s.connect ..., ...
...
s.setUnicodeLittleEndian()
s.writeLineAsUnicode( "abc" )
...
boolean isUnicodeBigEndian()N/ATrue/Falsereturns True if operating in Big Endian mode.
boolean isUnicodeLittleEndian()N/ATrue/Falsereturns True if operating in Little Endian mode.
Unicode Read Functions
string readLineAsUnicode()
throws com exception
N/Astring
(BSTR in C++)
Reads a Unicode line. Input must be double byte character. Automatically detects Endianess Byte Order Mask (BOM), and converts to the current Endian Mode.
...
myString = s.readLine()
...
string
readLineWithoutNewLineUnicode()
throws com exception
N/Astring
(BSTR in C++)
Reads a Unicode line, but last carriage return is chopped. i.e., "\r\n" or "\n" character is chopped off from the input. Automatically detects Endianess Byte Order Mask (BOM), and converts to the current Endian Mode.

...if input was "abc\r\n"

myString = s.readLineWithoutNewLine()
...returns "abc"
Unicode Write Functions
writeAsUnicode(string)
throws com exception
stringN/AWrites the specified string as Unicode out to the connection.
writeLineAsUnicode
throws com exception
stringN/AWrites the string as unicode out to the connection with a newline (\r\n = vbCrLf)
...
s.writeLineAsUnicode("abc")
...
' writes "abc\r\n"
writeUnicodeEndianessHeader
throws com exception
N/AN/AWrites Unicode Endianess Bytes.
For Little Endian mode (default), writes
"0xFF 0xFE", and for Big Endian mode, writes
"0xFE 0xFF".
This is same as writing 2 byte array depending on current mode.

Example:
...
s.setUnicodeLittleEndian()
s.writeUnicodeEndianessHeader()
s.writeLineAsUnicode("Test...")
...
    

Active Socket Object Example (Visual Basic)
' This example connects to aspobjects.com homepage, and displays HTML

' to use TypeLibrary, make sure to check
' Reference comSocket.SocketObj 3.5 Type Library

Function test_socket
Dim s As New comSocket.SocketObj

On error Goto SocketErr
'Set s = CreateObject("comSocket.SocketObj")
s.timeout = 5000
dim url
url = "www.comsoltech.com"
s.Connect url, 80
Dim buf As String
If Not s.isconnected Then
   MsgBox "Failed connecting...." & s.Err
Exit Sub
Else

End If

s.writeLine "GET / HTTP/1.1"
s.writeLine "Host: " & url
s.writeLine ""

Dim more As Boolean
more = True
While (more)
   buf = buf & s.readLine
   If (s.EOF) Then
      more = False
   End If
Wend
s.disconnect
Set s = Nothing
MsgBox "buffer size = " & Len(buf)

Exit Function
ErrSocket:
Msgbox "Socket Err: " & s.getError
End Function


Active Socket Object Example (ASP)
 ' This example connects 
to yahoo.com homepage, and displays HTML 
dim s set s = server.createObject("comSocket.SocketObj") s.timeout = 5000 url = "www.yahoo.com" s.connect url, 80 if not s.isconnected then Response.Write "Failed connecting...." & s.err Response.End else s.writeLine "GET / HTTP/1.1" s.writeLine "Host: " & url s.writeLine "" more = 1 while(more) buf = s.readLine if( s.EOF ) then more = 0 else Response.Write buf & vbCrLf end if wend s.disconnect set s = nothing end if

Further instructions and documentation are available in
doc.htm file included in the distruction,
or online at http://www.comsoltech.com/products/components/
support@comsoltech.com


DOWNLOAD (30 DAYS TRIAL)

Download Active Socket Object 3.5

 
627 KB


Order online:

1 Server License - $45.00
2 Servers License
- $89.00
3 Servers License
- $129.00
5 Servers License
- $204.00

Site License
- $350.00 - Unlimited within a single location (site)
Enterprise License - $1200.00 - Unlimited within a single company / organization
Developer License - $399.00 - Royalty free unlimited distribution within your product

(as long as the final product is not another socket-only product)


To order Active Socket Object Component via phone, please call RegNet at 1-800-999-2734 (U.S. customers only) and International customers can call RegNet at 1-805-288-1827. Please allow 12-24 hours for order processing.

(C) 1998 - 2008 Comsoltech® Incorporated. All Rights Reserved. info@comsoltech.com
Comsoltech is a registered trademark of Comsoltech Incorporated.
Home | Products | Development
4Templates.com