<commit_before>
#Print "Target: ${TARGET} Lang: ${LANG}"

#If (LANG="cpp" And TARGET<>"win8") Or LANG="java" Or TARGET="xna"

	Import brl.stream
	Import tcpsocket
	#If LANG="cpp" Or LANG="java"
		Import "native/tcpserver.${LANG}"
	#Else
		Import "native/tcpserver.${TARGET}.${LANG}"
	#End

	Extern
	
	Class BBTcpServer

		Method SetupListen:Bool(port:Int)
		Method CheckConnection:Bool()
		Method SetupSocket:Bool(bbTcpSocket:BBTcpSocket)

	End
	
	Public
	
	Class TcpServer

		Method New()
			_server=New BBTcpServer
		End
		
		Method SetupListen:Bool(port:Int)
			Return _server.SetupListen(port)
		End
		
		Method CheckConnection:TcpSocket()

			If _server.CheckConnection() = True Then
			
				Local tcpSocket:TcpSocket = New TcpSocket()
				
				_server.SetupSocket(tcpSocket.GetBBTcpSocket())
				
				Return tcpSocket
			
			End If
			
			Return Null

		End

		'***** INTERNAL *****
		Method GetBBTcpServer:BBTcpServer()
			Return _server
		End
		
		Private
		
		Field _server:BBTcpServer
		
	End

#Else

	#Error "PushButton Networking is not available on this target."

#End<commit_msg>Adding detail error messages for HTML5 and Flash<commit_after>
#Print "Target: ${TARGET} Lang: ${LANG}"

#If (LANG="cpp" And TARGET<>"win8") Or LANG="java" Or TARGET="xna"

	Import brl.stream
	Import tcpsocket
	#If LANG="cpp" Or LANG="java"
		Import "native/tcpserver.${LANG}"
	#Else
		Import "native/tcpserver.${TARGET}.${LANG}"
	#End

	Extern
	
	Class BBTcpServer

		Method SetupListen:Bool(port:Int)
		Method CheckConnection:Bool()
		Method SetupSocket:Bool(bbTcpSocket:BBTcpSocket)

	End
	
	Public
	
	Class TcpServer

		Method New()
			_server=New BBTcpServer
		End
		
		Method SetupListen:Bool(port:Int)
			Return _server.SetupListen(port)
		End
		
		Method CheckConnection:TcpSocket()

			If _server.CheckConnection() = True Then
			
				Local tcpSocket:TcpSocket = New TcpSocket()
				
				_server.SetupSocket(tcpSocket.GetBBTcpSocket())
				
				Return tcpSocket
			
			End If
			
			Return Null

		End

		'***** INTERNAL *****
		Method GetBBTcpServer:BBTcpServer()
			Return _server
		End
		
		Private
		
		Field _server:BBTcpServer
		
	End

#Else If TARGET="html5"

	#Error "PushButton Networking server is not available on HTML5, because HTML5 can not listen for connection."

#Else If TARGET="flash"

	#Error "PushButton Networking server is not available on Flash, because Flash can not listen for connection."

#Else

	#Error "PushButton Networking is not available on this target."

#End
{'fraction_non_alphanumeric': 0.10100200400801604, 'fraction_numerical': 0.002404809619238477, 'mean_word_length': 3.8, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6489092', 'n_tokens_mistral': 993, 'n_tokens_neox': 817, 'n_words': 224}