title: Why is my TCP connection closing?
body: <p>I have developed an application for my game server. Now, in this application when I press "Connect" it sends data to my Game Server. And it does, but, the problem is, when it sends the connection it automatically closes it, and I don't want to close it because I have a socket plugin that kills the TCP connection after player leaves the game. Now on my localhost it works, the TCP doesn't "die" but on my vps it disconnects, can someone please check my code and see if I'm doing something wrong?</p>
  
  <pre><code>Dim p() As Process
                              Dim gta() As Process
  
                              p = Process.GetProcessesByName("samp")
                              gta = Process.GetProcessesByName("gta_sa")
  
                              If p.Count &gt; 0 Then
                                  MsgBox("Vec imate pokrenut SAMP - ugasite ga.")
  
                              ElseIf gta.Count &gt; 0 Then
                                  MsgBox("Vec imate pokrenut GTA San Andreas - ugasite ga.")
  
                              Else
  
  
                                  Try
                                      Dim prozess As Process = Process.GetProcessesByName("samp")(0)
                                      prozess.Kill()
                                  Catch ex As Exception
  
                                  End Try
                                  My.Computer.Registry.SetValue("HKEY_CURRENT_USER\Software\SAMP", "PlayerName", TextBox1.Text)
                                  Process.Start("samp://164.132.229.172:7777")
  
  
  
                                  Dim client As New TcpClient()
                                  client.Connect("164.132.229.172", 7775)
                                  Dim sendBytes As [Byte]() = System.Text.Encoding.ASCII.GetBytes(TextBox1.Text)
  
                                  Dim stream As NetworkStream = client.GetStream()
                                  stream.Write(sendBytes, 0, sendBytes.Length)
  
                                  Timer1.Start()
  
                              End If
  
                          End If
  </code></pre>
  
  <p>Timer:</p>
  
  <pre><code>Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
      Dim pd() As Process
      pd = Process.GetProcessesByName("Aimbot By The2Gamers")
      If pd.Count &gt; 0 Then
          Dim InternetExplorer() As Process = Process.GetProcessesByName("Aimbot By The2Gamers")
          For Each Process As Process In InternetExplorer
              Process.Kill()
          Next
      End If
  End Sub
  </code></pre>
  
  <p>Now this part down here is only server log from my vps:</p>
  
  <blockquote>
    <p>[01:12:15] [LAUNCHER] Connection to Socket Server. | ClientID: [0] |
    ClientIP: [92.241.153.29]  [01:12:15] Remote client [0] has sent:
    Joan_Mackey [01:12:16] [LAUNCHER] Player Socket disconnected|
    ClientID: [0] | PlayerID: [0]</p>
  </blockquote>