|
-
Jun 15th, 2001, 07:44 AM
#1
My server with a socket doesn't work
I'v made a server component, (ActiveX exe) with 2 sub's and a few event handlers. The Idea is to let a client exe use the server component to connect to a VMS server.
The following should happen:
1) In client.exe: a user presses the connect button
2) In server.exe: "Connect" method gets called.
3) The "Connect" method initialized the socket control
with a hostname and a port number. Once this completes
a "connect" event should occur.
4) In server.exe: The "connect" event is handled and a
logon string is sent to the socket control which inturn passes
it on to the VMS server.
5) In server.exe: DataArrival events can occur...
However, none of the events work in my App!!! Steps 1 and 2 complete, meaning that the socket was initialized and connected to the VMS server but the "connect" event never fired. Why???
Here's the code:
Server code: A standard ActiveX exe with Single use instancing.
The class module code
============================================
Option Explicit
Public Sub ConnectToVMS()
Load Form1
Form1.Winsock1.RemoteHost = "SomeServer"
Form1.Winsock1.RemotePort = 6666
Form1.Winsock1.Connect
End Sub
Private Sub Winsock1_Connect()
Dim strLogin As String
strLogin = "logon string"
Form1.Winsock1.SendData strLogin
End Sub
Private Sub Winsock1_DataArrival(ByVal bytesTotal As Long)
Dim data As String
Form1.Winsock1.GetData data, vbString
End Sub
Public Sub CloseServer()
Form1.Winsock1.Close
End Sub
============================================
Form1 code, lies in same project as the server class module
Private Sub Winsock1_Connect()
Dim strLogin As String
strLogin = "logon string"
Winsock1.SendData strLogin
End Sub
Private Sub Winsock1_DataArrival(ByVal bytesTotal As Long)
Dim data As String
Winsock1.GetData data, vbString
End Sub
I've added the event handlers to both the module and the form, neither gets fired (ok I'm desperate!)
What am I missing?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|