Click here to Skip to main content
13,004,215 members (80,184 online)
Rate this:
Please Sign up or sign in to vote.
Hello everyone,
while i am trying to execute the following code there is nothing in task bar. I mean, there is no executing form. :( Please help me with this.

Imports System.Net.Sockets
Imports System.Text
Public Class Form1
    Public Shared serverSocket As New TcpListener(System.Net.IPAddress.Any, 8888)
    Public Shared requestCount As Integer
    Public Shared clientSocket As TcpClient
    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        clientSocket = serverSocket.AcceptTcpClient()
        TextBox1.AppendText("Accept connection from client..")
        requestCount = 0
        While (clientSocket.Connected = True)
                requestCount = requestCount + 1
                Dim networkStream As NetworkStream = clientSocket.GetStream()
                Dim bytesFrom(10024) As Byte
                networkStream.Read(bytesFrom, 0, CInt(clientSocket.ReceiveBufferSize))
                Dim dataFromClient As String = System.Text.Encoding.ASCII.GetString(bytesFrom)
                dataFromClient = dataFromClient.Substring(0, dataFromClient.IndexOf("$"))
                Dim serverResponse As String = "Server response " + Convert.ToString(requestCount)
                Dim sendBytes As [Byte]() = Encoding.ASCII.GetBytes(serverResponse)
                networkStream.Write(sendBytes, 0, sendBytes.Length)
            Catch ex As Exception
            End Try
        End While
    End Sub
    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
    End Sub
End Class
Posted 30-May-13 20:44pm
Updated 30-May-13 21:33pm

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web02 | 2.8.170627.1 | Last Updated 31 May 2013
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100