Click here to Skip to main content
Rate this: bad
good
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. Frown | :( 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
        serverSocket.Start()
        TextBox1.AppendText("Started..")
        clientSocket = serverSocket.AcceptTcpClient()
        TextBox1.AppendText("Accept connection from client..")
        requestCount = 0
        While (clientSocket.Connected = True)
            Try
                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("$"))
                TextBox1.AppendText(dataFromClient)
                Dim serverResponse As String = "Server response " + Convert.ToString(requestCount)
                Dim sendBytes As [Byte]() = Encoding.ASCII.GetBytes(serverResponse)
                networkStream.Write(sendBytes, 0, sendBytes.Length)
                networkStream.Flush()
                TextBox1.AppendText("serverResponse")
            Catch ex As Exception
                MsgBox(ex.ToString)
            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 21:44pm
Edited 30-May-13 22:33pm
(no name)398.8K
v2

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

  Print Answers RSS
0 OriginalGriff 304
1 Sergey Alexandrovich Kryukov 255
2 Shweta N Mishra 216
3 Maciej Los 210
4 PIEBALDconsult 174
0 OriginalGriff 7,660
1 Sergey Alexandrovich Kryukov 7,072
2 DamithSL 5,586
3 Manas Bhardwaj 4,946
4 Maciej Los 4,665


Advertise | Privacy | Mobile
Web04 | 2.8.1411023.1 | Last Updated 31 May 2013
Copyright © CodeProject, 1999-2014
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