Information Technology Reference
In-Depth Information
Height = 375
Left = 120
TabIndex = 6
Top = 2520
Width = 1575
End
Begin VB.Label Label2
Caption = "ShowText"
Height = 255
Left = 120
TabIndex = 3
Top = 1200
Width = 3615
End
Begin VB.Label Label1
Caption = "SendTextData"
Height = 255
Left = 120
TabIndex = 2
Top = 240
Width = 3615
End
End
Attribute VB_Name = "myServer"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
'Last modification: 15/11/99
Private Sub Form_Load()
Unload ChoiceSC 'Close main menu properly
'Set the local port to 1001 and listen for a connection
myTCPServer.LocalPort = 1001
myTCPServer.Listen
ConnectionState.Text = "Disconnected"
DisConnect.Enabled = False
End Sub
Private Sub myTCPServer_Close()
'Close method
myTCPServer.Close
ConnectionState.Text = "Disconnected"
SendTextData.Enabled = False
End Sub
Private Sub myTCPServer_ConnectionRequest(ByVal requestID As Long)
'Check state of socket, if it is not closed then close it.
If myTCPServer.State <> sckClosed Then myTCPServer.Close
'Accept the request with the requestID parameter.
myTCPServer.Accept requestID
ConnectionState.Text = "Connected"
DisConnect.Enabled = True
CloseS.Enabled = False
SendTextData.Enabled = True
End Sub
Private Sub SendTextData_Change()
'SendTextData contains the data to be sent
'This data is sent using the SendData method
myTCPServer.SendData SendTextData.Text
End Sub
Search WWH ::




Custom Search