本文介绍了TCP服务器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Ciao ...
Windows CE 6.0中的应用程序在ascolto中起决定作用. Vorrei gestirlo在多线程游戏中的播放器和监听器中显示了所有消息. Da cosa puo dipendere ???

vi posto il mio TCPServer:


Ciao...
ho un applicazione che gira su windowsCE 6.0 con un tcplistener in ascolto su una determinata porta. Vorrei gestirlo in multithreading ma ad un certo punto il mio pc si pianta e fino a quando nn muovo qualcosa sul pc, il listener non accetta più richieste. Da cosa puo dipendere???

vi posto il mio TCPServer:


Public Sub Server()
     tcpListener = New TcpListener(IPAddress.Any, 50000)
     listenThread = New Threading.Thread(New Threading.ThreadStart(AddressOf ListenForClients))
     listenThread.Start()

 End Sub

 Private Sub ListenForClients()
     tcpListener.Start()
     Console.WriteLine("Server avviato")

     While (True)
         Try
             Dim client As TcpClient = tcpListener.AcceptTcpClient()
             clientSocket = client

             Dim clientThread As Threading.Thread = New Threading.Thread(New Threading.ThreadStart(AddressOf doChat))
             clientThread.Start()

         Catch ex As Exception
             Console.WriteLine("Errore server. Riavviare")
             Close()
         End Try

     End While
 End Sub




使用Google翻译进行翻译:
你好...
我有一个在WindowsCE 6.0上运行的应用程序,其中TcpListener侦听端口.我将以多线程处理它,但有时我的计算机挂起,直到nn在计算机上移动某些东西之前,侦听器不再接受更多请求.可能取决于什么?
[/EDIT]




Translation using Google translate :
Hello ...
I have an application that runs on WindowsCE 6.0 with a TcpListener listening on a port. I would handle it in multithreaded but at some point my computer hangs and until nn move something on the computer, the listener does not accept more requests. May depend on what??
[/EDIT]

推荐答案


这篇关于TCP服务器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-24 13:22