Thanks for your reply binary1248. I tried to accept() and disconnect() socket and it's work ok.
Just I said, if I close the listener, the server doesn't receive more packets from clients. I uploaded a simply code here:
http://sdrv.ms/17wMIf5Basically the server start and listen for client connection request. When arrives one, accepts and send to client the game map, his player id, his player position, number of players and all the player positions. When receive a player position request, check if is avaiable and send this new position for all the players.
In the client side, its connect to server and receive the map game, his id, position and all player positions.
When the player wants to move (with arrow keys: left, right, up, down), send the requested new position to server, if its available, receive an answer and move to it. Also, if receive a position of one rival, set it.
I limited the number of players to 4, when a 5th client attempts to connect, show the error message, close listener and since then, the server doesn't receive the clients data. It's a bug or works properly?
I use SFML 2.1 with Code::Blocks 12.11 (Windows 8 Pro, 32 bits)