Рефактор.
This commit is contained in:
@@ -250,9 +250,9 @@ func poll_receive_udp(sock: Socket) -> bool:
|
||||
|
||||
|
||||
func poll_receive_tcp(sock: SocketTCP) -> bool:
|
||||
if sock.is_connection_available(): # check if someone's trying to connect
|
||||
var client: = sock.take_connection() # accept connection
|
||||
sock.peerstream.set_stream_peer(client) # bind peerstream to new client
|
||||
if sock.is_connection_available(): # Проверить, если кто то пытается подключиться
|
||||
var client: = sock.take_connection() # Принять соединение
|
||||
sock.peerstream.set_stream_peer(client) # Привязать поток к новому клиенту
|
||||
log.info('подключен: %s:%d к порту: %d' % [ client.get_connected_host(), client.get_connected_port(), client.get_local_port() ] )
|
||||
var peer = sock.peerstream.get_stream_peer()
|
||||
if peer:
|
||||
|
||||
Reference in New Issue
Block a user