VERSION 5.00 Object = "{248DD890-BB45-11CF-9ABC-0080C7E7B78D}#1.0#0"; "MSWINSCK.OCX" Begin VB.Form Form1 BorderStyle = 1 'Fixed Single Caption = "Server" ClientHeight = 4065 ClientLeft = 45 ClientTop = 330 ClientWidth = 5010 LinkTopic = "Form1" MaxButton = 0 'False ScaleHeight = 4065 ScaleWidth = 5010 StartUpPosition = 3 'Windows Default Begin VB.TextBox txtmsg Height = 375 Left = 120 TabIndex = 2 Top = 3600 Width = 3615 End Begin VB.CommandButton Command2 Caption = "&Send" Height = 375 Left = 3840 TabIndex = 1 Top = 3600 Width = 1095 End Begin VB.TextBox txtchat Height = 3375 Left = 120 MultiLine = -1 'True ScrollBars = 2 'Vertical TabIndex = 0 Top = 120 Width = 4815 End Begin MSWinsockLib.Winsock Winsock Left = 0 Top = 0 _ExtentX = 741 _ExtentY = 741 _Version = 393216 LocalPort = 7777 End End Attribute VB_Name = "Form1" Attribute VB_GlobalNameSpace = False Attribute VB_Creatable = False Attribute VB_PredeclaredId = True Attribute VB_Exposed = False Private Sub Command2_Click() Winsock.SendData "Server: " & txtmsg.Text txtchat.Text = txtchat.Text & "Server: " & txtmsg.Text & vbNewLine txtmsg.Text = "" End Sub Private Sub Form_Load() Winsock.Listen End Sub Private Sub Winsock_ConnectionRequest(ByVal requestID As Long) Winsock.Close Winsock.Accept requestID End Sub Private Sub Winsock_DataArrival(ByVal bytesTotal As Long) Winsock.GetData dataArrived, vbString txtchat.Text = txtchat.Text & dataArrived & vbNewLine End Sub