SocketWrench

robot313
09-08-2001, 08:58 AM
I don't know why this code doesn't work. It's the code it says to use in the SocketWrench Developer's Guide for a sample program.

I'm using this code:

<pre><font color=blue>Private</font color=blue> <font color=blue>Sub</font color=blue> Form_Load()
Socket1.AddressFamily = AF_INET
Socket1.Protocol = IPPROTO_IP
Socket1.SocketType = SOCK_STREAM
Socket1.Binary = <font color=blue>False</font color=blue>
Socket1.Blocking = <font color=blue>False</font color=blue>
Socket1.BufferSize = 1024

Socket2(0).AddressFamily = AF_INET
Socket2(0).Protocol = IPPROTO_IP
Socket2(0).SocketType = SOCK_STREAM
Socket2(0).Blocking = <font color=blue>False</font color=blue>
Socket2(0).LocalPort = IPPORT_ECHO
Socket2(0).Action = SOCKET_LISTEN
LastSocket = 0
<font color=blue>End</font color=blue> <font color=blue>Sub</font color=blue></pre>

When I run the program it says:
Run-time error '24044':
Specified socket type is not supported in this address family.

Thinker
09-08-2001, 09:00 AM
Did you include the correct cswsock.bas standard module in your project?
If not then copy the correct file, for your version of VB, to the directory
where your project is saved. Then, from the project explorer window,
right-click on the project and select add/Module and select the Existing
tab. Select the cswsock.bas file that you copied into the directory and
click Open.


I think therefore I am... sometimes right. images/icons/wink.gif

robot313
09-08-2001, 09:02 AM
Where do I get cswsock.bas ?

Thinker
09-08-2001, 09:03 AM
There should have been different versions included in the package you
downloaded.

I think therefore I am... sometimes right. images/icons/wink.gif

robot313
09-08-2001, 09:15 AM
I found it in the SocketWrench samples folder and it's called Wrench.bas Now the program works fine!

Thinker
09-08-2001, 09:21 AM
Great. I guess I have the older version. Maybe I should download the
newer one too.

I think therefore I am... sometimes right. images/icons/wink.gif

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum