Desaware Home
Products    Purchase    Publishing    Articles   Support    Company    Contact    
Support
Product FAQ
Licensing System
CC Factory
Event Log Toolkit
Gallimaufry
IniFile Tool-5M
LineGraph-5M
NT Service Toolkit
OneTime Download
SpyWorks
StateCoder
StorageTools
VBX Legacy
VersionStamper
Downloads
Documentation
Professional Services

 

bluebar
Contact Desaware and order today

bluebar
Sign up for Desaware's Newsletter for the latest news and tech tips.

SpyWorks Support

Frequently Asked Questions - Winsock

  1. I am having problems with the Spyworks WinSock component. I cannot get the SpyWorks TCPClient to connect to my "non-SpyWorks" TCP Server or vice versa.
  2. I am using the WinSock in SpyWorks and I cannot send more than 8192 bytes in a udp message. Is this a restriction?
  3. On certain web sites, the dwhttp object returns a "Not Found" error even though the file exists. Why does this happen?
  4. I am trying to send a file using the dwsmtp component as an inline attachment. The email is received but the document is not properly transformed.
  5. When using the SMTP component, it would generate a subscript out of range error when attaching certain files.

1. I am encountering a weird behavior with the SpyWorks WinSock component. I used the SpyWorks sample projects TCPclient and TCPServ successfully to connect to each other. However, I cannot get the SpyWorks TCPClient to connect to my "non-SpyWorks" TCP Server or vice versa. I have tried both Port 2000 and other arbitrary port numbers.

There was a bug with our EchoTCP, TCP Client and TCP Server samples. Basically, we did not "dereference" the port address. So, our two TCP Client and Server samples worked fine together because they both had the same bug. But, these samples would not talk to other applications because the other applications probably correctly dereferenced the port address while ours did not. Download the following sample project to view a corrected sample project. ( tcpsamps.zip ,  31KB)

The following code changes fixes the problem in the original project:

In tcpclient.frm:

In:

Sub Form_Load() 

Change:

ListenAddr.Port = 2000 

To:

' we'll set the port to 2000, but first must convert it into the 
' Internet Standard format 
ListenAddr.Port = TCPSource.SocketsObject.Util.htons(2000) 

In tcpserv.frm:

In:

Sub Form_Load() 

Change:

ListenAddr.Port = 2000 

To:

' We want to set our server to listen at port 2000, but we need to 
' convert 2000 to the Internet Standard format first 
' (otherwise, we'll be listening port 53255) 
ListenAddr.Port = TCPSource.SocketsObject.Util.htons(2000) 

In:

Sub TCPSource_AcceptComplete() 
Change: 
List1.AddItem "Connected to: " & 
TCPSource.SocketsObject.Util.inet_ntoa(
NewSocketName.IpAddress) & " Port:" & NewSocketName.Port 

To:

List1.AddItem "Connected to: " & 
TCPSource.SocketsObject.Util.inet_ntoa(
NewSocketName.IpAddress) & " Port:" & 
TCPSource.SocketsObject.Util.ntohs(NewSocketName.Port) 
In: 

Sub TCPSource_SocketClosed()

Change:

List1.AddItem "Socket Closed: " & 
TCPSource.SocketsObject.Util.inet_ntoa(
SourceSocket.SocketName.IpAddress) & " Port:" & 
SourceSocket.SocketName.Port 

To:

List1.AddItem "Socket Closed: " & 
TCPSource.SocketsObject.Util.inet_ntoa(
SourceSocket.SocketName.IpAddress) & " Port:" & 
TCPSource.SocketsObject.Util.ntohs(SourceSocket.SocketName.Port) 

In echotcp.frm:

In:

Sub Form_Load() 

Change:

ListenAddr.Port = 2000 

To:

ListenAddr.Port = TCPSource.SocketsObject.Util.htons(2000) 

In:

Sub TCPSource_AcceptComplete() 

Change:

List1.AddItem TCPSource.SocketsObject.Util.inet_ntoa(
NewSocketName.IpAddress) & " Port:" & NewSocketName.Port 

To:

List1.AddItem TCPSource.SocketsObject.Util.inet_ntoa(
NewSocketName.IpAddress) & " Port:" & 
TCPSource.SocketsObject.Util.ntohs(NewSocketName.Port) 


2. I am using the WinSock in SpyWorks and I cannot send more than 8192 bytes in a udp message. Is this a restriction? The MSDN says only that some implementations of sockets are limited to 8192, not that the socket implementation in Windows is limited to that .

This was a bug in our interpretation of the document. The dwUDP object now handles large udp messages correctly.


3.
On certain web sites, the dwhttp object returns a "Not Found" error even though the file exists. Why does this happen?

Some web sites requires a "Host Header" to be sent along on a HTTP "GET" request. Our component now sends that header along with every "GET" request.


4. I am trying to send a file using the dwsmtp component as an inline attachment. The email is received but the document is not properly transformed.

We had a misprint in the help file for the AutoFileHeader function. The FileType's base value starts at 0 instead of 1, so it could be that the FileType is off by 1. For example, for an html file, set the FileType to 5 instead of 6.


5.
When using the SMTP component, it would generate a subscript out of range error when attaching certain files.

We had a bug in the LoadCompressedLine function that would not send files with a certain size correctly. Run the SpyWorks run time files update to retrieve the latest SMTP component.


 
Products    Purchase    Articles    Support    Company    Contact
Copyright© 2012 Desaware, Inc. All Rights Reserved.    Privacy Policy