Free ebook 
Free Visual Basic and Winsock ebook. Free ebook - TCP client - server. Winsock State sckConnected

      Free ebook
  [ Winsock ]    [ Main page ]

    Visual Basic Winsock sckConnected
    Ebook. Returns the state of the socket connection.
    

Visual Basic TCP Client-Server


    
    Automation Word >>  Proxy on VB >>  Wallpaper changer on VB >>  Web Design tutorial >>
  

    Visual Basic
    
    When you create an application that uses the TCP protocol, the first thing you need to decide is what your application will be a client or server. If you create an application server, then your application will listen to the specified port. When the client application makes a connection request, the server application can accept the request and thus establish a connection. If the connection is established, the client application and the server application can freely exchange data.
    
    //Set the port number to be accessed data exchange by assigning a value to the LocalPort property
    //Call the Listen method
    
    Private Sub Form_Load()
    tcpServer.LocalPort = 1001
    tcpServer.Listen
     frmClient.Show
    End Sub
    
    //The State property is checked to see if the previous connection was completed. If not completed, before establishing a new connection, the old one is forcibly closed.
    
    Private Sub tcpServer_ConnectionRequest(ByVal requestID As Long)
    If tcpServer.State sckClosed Then tcpServer.Close
    //Accept the Accept request with the requestID connection setup check parameter.
    tcpServer.Accept requestID
    End Sub
    
    Private Sub txtSendData_Change()
    //Text field DateData contains data to be transmitted. All characters that will be entered in this text field will be sent as a single line to the client application using the SendData method.
    tcpServer.SendData txtSendData.Text
    End Sub
    
    Private Sub tcpServer_DataArrival(ByVal bytesTotal As Long)
    //A buffer variable is declared for the received data. The GetData method is called and the Text property of the txtOutput text field is assigned the value of a buffer variable.
     Dim strData As String
    tcpServer.GetData strData
    txtOutput.Text = strData
    End Sub
    
    It turned out a simple server application on Visual Basic.
    
    
Source CODE >>
    
    Visual Basic Source Code. TCP Client-Server

    

Visual Basic TCP Client-Server


    Free ebook Free Visual Basic and Winsock ebook. Free ebook - TCP client - server. Winsock State sckConnected

Visual Basic. Free Visual Basic and Winsock ebook. Free ebook - TCP client - server. Winsock State sckConnected VB Winsock
Winsock sckConnected