Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
mswinsck.ocx
When you call senddata and you single step there is a lot of time (in
processor terms) between the call to connect and senddata. When you reached senddata, the underlying socket had a chance to connect. However if run full throttle the underlying socket is not yet connected. You might wan't to add this before the call to send data: ' wait for connection While winsock.state < sckConnected Wend Hope this helps. "Fung" wrote: Hello I use the following codes to pass a socket message to another server. It works in the debug mode when I execute it step by step using F8. However, it returns error when I execute it by pressing F5 or by clicking CommandButton1. The error is: [40006] Wrong protocol or connection state for the requested transaction or request. Any idea about this? Private WinSock As Object Private Sub CommandButton1_Click() Set WinSock = New MSWinsockLib.WinSock With Winsock .Protocol = sckTCPProtocol .RemoteHost = "server1-2000" .RemotePort = 690 .Connect End With Winsock.SendData strMessage End Sub |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
mswinsck.ocx | Excel Programming |