home *** CD-ROM | disk | FTP | other *** search
- VERSION 5.00
- Object = "{248DD890-BB45-11CF-9ABC-0080C7E7B78D}#1.0#0"; "MSWINSCK.OCX"
- Object = "{3B7C8863-D78F-101B-B9B5-04021C009402}#1.1#0"; "RICHTX32.OCX"
- Begin VB.Form PlatWSCont41Srv
- BackColor = &H00FFFFFF&
- Caption = "Platinum Ch 41 Server"
- ClientHeight = 5595
- ClientLeft = 60
- ClientTop = 345
- ClientWidth = 5880
- LinkTopic = "Form1"
- ScaleHeight = 5595
- ScaleWidth = 5880
- StartUpPosition = 3 'Windows Default
- Begin VB.CommandButton cmdReadLocalPort
- Caption = "Read Local Port"
- Height = 375
- Left = 3960
- TabIndex = 13
- Top = 5160
- Width = 1695
- End
- Begin VB.CommandButton cmdReadServerState
- Caption = "Read Server State"
- Height = 375
- Left = 3960
- TabIndex = 12
- Top = 4740
- Width = 1695
- End
- Begin VB.CommandButton cmdReadRemotePort
- Caption = "Read RemotePort"
- Height = 375
- Left = 3960
- TabIndex = 11
- Top = 4320
- Width = 1695
- End
- Begin VB.TextBox txtrequestID
- Height = 375
- Left = 1920
- TabIndex = 10
- Text = "requestID or Local Port"
- Top = 5160
- Width = 1995
- End
- Begin VB.TextBox txtServerState
- Height = 375
- Left = 1920
- TabIndex = 8
- Text = "Server State"
- Top = 4740
- Width = 1995
- End
- Begin VB.TextBox txtRemotePort
- Height = 375
- Left = 1920
- TabIndex = 6
- Text = "RemotePort"
- Top = 4320
- Width = 1995
- End
- Begin MSWinsockLib.Winsock wskServer
- Left = 4980
- Top = 240
- _ExtentX = 741
- _ExtentY = 741
- End
- Begin RichTextLib.RichTextBox rtbServInBound
- Height = 1215
- Left = 180
- TabIndex = 2
- Top = 3000
- Width = 5475
- _ExtentX = 9657
- _ExtentY = 2143
- _Version = 327680
- TextRTF = $"PlatWECont41Srv.frx":0000
- End
- Begin RichTextLib.RichTextBox rtbServOutBound
- Height = 1215
- Left = 180
- TabIndex = 1
- Top = 1260
- Width = 5475
- _ExtentX = 9657
- _ExtentY = 2143
- _Version = 327680
- MousePointer = 3
- TextRTF = $"PlatWECont41Srv.frx":00D7
- End
- Begin VB.Label lblrequestID
- Alignment = 2 'Center
- BackColor = &H00FF0000&
- BorderStyle = 1 'Fixed Single
- Caption = "requestID"
- BeginProperty Font
- Name = "MS Sans Serif"
- Size = 12
- Charset = 0
- Weight = 700
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- ForeColor = &H00FFFFFF&
- Height = 375
- Index = 1
- Left = 180
- TabIndex = 9
- Top = 5160
- Width = 1695
- End
- Begin VB.Label lblSErverState
- Alignment = 2 'Center
- BackColor = &H00FF0000&
- BorderStyle = 1 'Fixed Single
- Caption = "Server State"
- BeginProperty Font
- Name = "MS Sans Serif"
- Size = 12
- Charset = 0
- Weight = 700
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- ForeColor = &H00FFFFFF&
- Height = 375
- Index = 1
- Left = 180
- TabIndex = 7
- Top = 4740
- Width = 1695
- End
- Begin VB.Label lblRemotelPort
- Alignment = 2 'Center
- BackColor = &H00FF0000&
- BorderStyle = 1 'Fixed Single
- Caption = "RemotePort"
- BeginProperty Font
- Name = "MS Sans Serif"
- Size = 12
- Charset = 0
- Weight = 700
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- ForeColor = &H00FFFFFF&
- Height = 375
- Left = 180
- TabIndex = 5
- Top = 4320
- Width = 1695
- End
- Begin VB.Label lblServInBnd
- Alignment = 2 'Center
- BackColor = &H000000FF&
- BorderStyle = 1 'Fixed Single
- Caption = "Inbound"
- BeginProperty Font
- Name = "MS Sans Serif"
- Size = 12
- Charset = 0
- Weight = 700
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- ForeColor = &H00FFFFFF&
- Height = 375
- Left = 180
- TabIndex = 4
- Top = 2580
- Width = 5475
- End
- Begin VB.Label lblServOutBnd
- Alignment = 2 'Center
- BackColor = &H000000FF&
- BorderStyle = 1 'Fixed Single
- Caption = "Outbound"
- BeginProperty Font
- Name = "MS Sans Serif"
- Size = 12
- Charset = 0
- Weight = 700
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- ForeColor = &H00FFFFFF&
- Height = 375
- Left = 180
- TabIndex = 3
- Top = 840
- Width = 5475
- End
- Begin VB.Label lblServer
- Alignment = 2 'Center
- BackColor = &H00FF0000&
- BorderStyle = 1 'Fixed Single
- Caption = "The Server"
- BeginProperty Font
- Name = "MS Sans Serif"
- Size = 24
- Charset = 0
- Weight = 700
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- ForeColor = &H00FFFFFF&
- Height = 615
- Left = 1140
- TabIndex = 0
- Top = 180
- Width = 3615
- End
- Attribute VB_Name = "PlatWSCont41Srv"
- Attribute VB_GlobalNameSpace = False
- Attribute VB_Creatable = False
- Attribute VB_PredeclaredId = True
- Attribute VB_Exposed = False
- Option Explicit
- Private Sub cmdReadLocalPort_Click()
- 'This reads and displays the LocalPort property.
- txtrequestID.Text = wskServer.LocalPort
- End Sub
- Private Sub cmdReadRemotePort_Click()
- 'Read the RemotePort property and display in the txtRemotePort.
- txtRemotePort.Text = wskServer.RemotePort
- End Sub
- Private Sub cmdReadServerState_Click()
- 'Read and Display the current Server State
- txtServerState.Text = wskServer.State
- End Sub
- Private Sub Form_Load()
- 'The name of the Winsock control for the server is wskServer
- ' This name is the object when setting a property such as
- ' object.property or wskServer.Property
- 'The LocalPort property can be set at design time or in code at runtime.
- ' The LocalPort property has a data type of Long Integer.
- ' This is port number on which the Server will be listening and must match
- ' the RemotePort property of the Client.
- wskServer.LocalPort = 1001
- 'The Listen method is used to start the server monitoring incoming requests
- ' for a connection.
- wskServer.Listen
- End Sub
- Private Sub rtbServOutBound_Change()
- 'The RichTextBox_Change event is being used to send data. The contents of the
- ' RichTextBox rtbServOutBound will be transmitted each time the contents of the
- ' Text property is changed. The SendData method is used with the argument of
- ' RichTextBox.Text
- wskServer.SendData rtbServOutBound.Text
- End Sub
- Private Sub wskServer_ConnectionRequest(ByVal requestID As Long)
- 'Check to determine whether the WinSock Control's state is closed.
- ' If it is not, then close the control before using the Accept method.
- If wskServer.State <> sckClosed Then wskServer.Close
- 'The control is now prepared to use the Accept method which will receive the
- ' ConnectionRequest from the Client.
- ' The argument for the Accept method is requestID
- wskServer.Accept requestID
- 'The requestID is displayed
- txtrequestID.Text = requestID
- End Sub
- Private Sub wskServer_DataArrival(ByVal bytesTotal As Long)
- 'The variable strData is declared to hold the incoming data. It is stored as
- ' a variant.
- Dim strData As String
- 'The GetData method takes the data from the incoming buffer and places it in
- ' the strData variable.
- wskServer.GetData strData
- 'The strData variable contents are placed in the RichTextBox rtbClntInBound.Text
- ' property
- rtbServInBound.Text = strData
- End Sub
-