home *** CD-ROM | disk | FTP | other *** search
- VERSION 5.00
- Object = "{C7212F93-30E8-11D2-B450-0020AFD69DE6}#1.0#0"; "SocketX.OCX"
- Begin VB.Form Form1
- Appearance = 0 'Flat
- BackColor = &H00C0C0C0&
- Caption = "Socket/X w/ Fast Notifications"
- ClientHeight = 2400
- ClientLeft = 1935
- ClientTop = 2745
- ClientWidth = 5130
- BeginProperty Font
- Name = "MS Sans Serif"
- Size = 8.25
- Charset = 0
- Weight = 700
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- ForeColor = &H80000008&
- LinkTopic = "Form1"
- PaletteMode = 1 'UseZOrder
- ScaleHeight = 2400
- ScaleWidth = 5130
- Begin SocketXCtl.SocketXCtl SocketXCtl1
- Left = 120
- Top = 0
- AcceptTimeout = 0
- BlockingMode = 0
- Blocking = -1 'True
- BroadcastEnabled= -1 'True
- ConnectTimeout = 0
- EventMask = 63
- KeepAliveEnabled= 0 'False
- LibraryName = "WSOCK32.DLL"
- LingerEnabled = 0 'False
- LingerMode = 0
- LingerTime = 0
- LocalAddress = ""
- LocalPort = 0
- OutOfBandEnabled= 0 'False
- ReceiveBufferSize= 8192
- ReceiveTimeout = 0
- RemoteAddress = ""
- RemoteName = ""
- ReuseAddressEnabled= 0 'False
- RemotePort = 0
- RouteEnabled = -1 'True
- SendTimeout = 0
- SendBufferSize = 8192
- SocketType = 0
- TcpNoDelayEnabled= 0 'False
- End
- Begin VB.TextBox Text3
- Appearance = 0 'Flat
- BeginProperty Font
- Name = "MS Sans Serif"
- Size = 8.25
- Charset = 0
- Weight = 400
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 285
- Left = 1800
- TabIndex = 2
- Text = "5"
- Top = 1320
- Width = 855
- End
- Begin VB.TextBox Text2
- Appearance = 0 'Flat
- BeginProperty Font
- Name = "MS Sans Serif"
- Size = 8.25
- Charset = 0
- Weight = 400
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 285
- Left = 1800
- TabIndex = 4
- Text = "80"
- Top = 960
- Width = 855
- End
- Begin VB.TextBox Text1
- Appearance = 0 'Flat
- BeginProperty Font
- Name = "MS Sans Serif"
- Size = 8.25
- Charset = 0
- Weight = 400
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 285
- Left = 1800
- TabIndex = 3
- Text = "198.211.8.88"
- Top = 600
- Width = 3015
- End
- Begin VB.CommandButton Command1
- Appearance = 0 'Flat
- BackColor = &H80000005&
- Caption = "Test Connection"
- BeginProperty Font
- Name = "MS Sans Serif"
- Size = 8.25
- Charset = 0
- Weight = 400
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 375
- Left = 1800
- TabIndex = 0
- Top = 1920
- Width = 1695
- End
- Begin VB.Label Label5
- Alignment = 1 'Right Justify
- Appearance = 0 'Flat
- BackColor = &H00C0C0C0&
- Caption = "(in secs)"
- BeginProperty Font
- Name = "MS Sans Serif"
- Size = 8.25
- Charset = 0
- Weight = 400
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- ForeColor = &H80000008&
- Height = 255
- Left = 840
- TabIndex = 8
- Top = 1560
- Width = 855
- End
- Begin VB.Label Label4
- Alignment = 1 'Right Justify
- Appearance = 0 'Flat
- BackColor = &H00C0C0C0&
- Caption = "Timeout:"
- BeginProperty Font
- Name = "MS Sans Serif"
- Size = 8.25
- Charset = 0
- Weight = 400
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- ForeColor = &H80000008&
- Height = 255
- Left = 480
- TabIndex = 5
- Top = 1320
- Width = 1215
- End
- Begin VB.Label Label3
- Alignment = 1 'Right Justify
- Appearance = 0 'Flat
- BackColor = &H00C0C0C0&
- Caption = "Remote Port:"
- BeginProperty Font
- Name = "MS Sans Serif"
- Size = 8.25
- Charset = 0
- Weight = 400
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- ForeColor = &H80000008&
- Height = 255
- Left = 360
- TabIndex = 7
- Top = 960
- Width = 1335
- End
- Begin VB.Label Label2
- Alignment = 1 'Right Justify
- Appearance = 0 'Flat
- BackColor = &H00C0C0C0&
- Caption = "Remote IP:"
- BeginProperty Font
- Name = "MS Sans Serif"
- Size = 8.25
- Charset = 0
- Weight = 400
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- ForeColor = &H80000008&
- Height = 255
- Left = 600
- TabIndex = 6
- Top = 600
- Width = 1095
- End
- Begin VB.Label Label1
- Appearance = 0 'Flat
- BackColor = &H00C0C0C0&
- Caption = "Result:"
- BeginProperty Font
- Name = "MS Sans Serif"
- Size = 8.25
- Charset = 0
- Weight = 400
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- ForeColor = &H80000008&
- Height = 255
- Left = 1080
- TabIndex = 1
- Top = 120
- Width = 3975
- End
- Attribute VB_Name = "Form1"
- Attribute VB_GlobalNameSpace = False
- Attribute VB_Creatable = False
- Attribute VB_PredeclaredId = True
- Attribute VB_Exposed = False
- Implements ISocketXCtlNotify
- Private Sub Command1_Click()
- MousePointer = 11
- Command1.Enabled = False
- Label1.Caption = "Result: "
- 'create the socket
- SocketXCtl1.LocalAddress = "0.0.0.0"
- SocketXCtl1.LocalPort = 0
- SocketXCtl1.Create
- 'configure the control with the socket
- 'of the remote server
- SocketXCtl1.RemoteAddress = Text1.Text
- SocketXCtl1.RemotePort = CInt(Text2.Text)
- SocketXCtl1.Blocking = False
- '
- 'attempt to connect
- SocketXCtl1.ConnectTimeout = CInt(Text3.Text)
- SocketXCtl1.Connect
- End Sub
- Private Sub Form_Load()
- SocketXCtl1.NotificationObject = Me
- End Sub
- Private Sub ISocketXCtlNotify_Accept(ByVal SocketXCtl As SocketXCtl.ISocketXCtl, ByVal SocketHandle As Long, ByVal ErrorCode As Integer)
- End Sub
- Private Sub ISocketXCtlNotify_Close(ByVal SocketXCtl As SocketXCtl.ISocketXCtl, ByVal ErrorCode As Integer)
- End Sub
- Private Sub ISocketXCtlNotify_Connect(ByVal SocketXCtl As SocketXCtl.ISocketXCtl, ByVal ErrorCode As Integer)
- End Sub
- Private Sub ISocketXCtlNotify_Done(ByVal SocketXCtl As SocketXCtl.ISocketXCtl, ByVal LastMethod As SocketXCtl.MethodsEnum, ByVal ErrorCode As Integer)
- If LastMethod = soxConnect Then
- If ErrorCode = 0 Then
- Label1.Caption = Label1.Caption & "Connection is up."
- Else
- Label1.Caption = Label1.Caption & "Connection is NOT up (" & CStr(ErrorCode) & ")."
- End If
- SocketXCtl1.Close
- Command1.Enabled = True
- MousePointer = 0
- End If
- End Sub
- Private Sub ISocketXCtlNotify_OutOfBandData(ByVal SocketXCtl As SocketXCtl.ISocketXCtl, ByVal ErrorCode As Integer)
- End Sub
- Private Sub ISocketXCtlNotify_Receive(ByVal SocketXCtl As SocketXCtl.ISocketXCtl, ByVal ErrorCode As Integer)
- End Sub
- Private Sub ISocketXCtlNotify_Send(ByVal SocketXCtl As SocketXCtl.ISocketXCtl, ByVal ErrorCode As Integer)
- End Sub
-