Welcome, Guest. Please login or register. Did you miss your activation email?

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Shimajda

Pages: [1] 2
1
Network / sf::SocketSelector limited to 64 connections on Windows?
« on: August 14, 2011, 10:35:37 am »
I had the same problem about year ago.
Windows event system is designed to handle max. 64 items, if you need more you should use threads - thats what i found on microsoft side.
I havent found any limits for linux (also ubuntu in my case) but its possible that i havent tested selectors for more than 1024 sockets.

2
Network / Question about selector speed.
« on: December 14, 2010, 02:44:48 pm »
For my second question answer is here:
http://stackoverflow.com/questions/411295/alternatives-to-winsock2-with-example-server-source-in-c
Brian R. Bondy describes why select() is limited to 64 in some os, and how to check it.
There was mentioned about "Input/output completion port (IOCP)" but its Windows NT solution.

3
Network / Question about selector speed.
« on: December 14, 2010, 02:01:03 pm »
Sorry forgot about some details:
For each selector we have timeout: 0.01
In second case all sockets are in non-blocking code (blocking mode would be suicide :) )

I forgot becouse I have no idea how can i handle multiple clients in case where they send data only if they need and server have other things to do than just waiting for clients. Another thing is that I can't use threads.

4
Network / Question about selector speed.
« on: December 14, 2010, 12:53:18 pm »
Does anyone knows how selector works?
Lets say that our selector can handle 64 sockets, and we have 640 connections to handle. So we have 10 selectors, 64 sockets for each and we check each selector for ready sockets.
Is that faster than iterating through simple socket array (or container)?

In http://www.sfml-dev.org/forum/viewtopic.php?t=1977&highlight=selector
Quote from: "Laurent"
Actually, the number of sockets that a selector can hold is OS-dependent. And it may perfectly be as low as 64.

How do i know how much sockets selector can handle in system that program is running?

5
Network / Blocking functions trouble shooting.
« on: November 11, 2010, 11:42:35 am »
If You're using 1.6 connect looks like this:
m_TcpSocket.Connect(m_Port, m_IpAddressHost)

Your connect returns anything? (sf::Socket::Disconnected, sf::Socket::Error)

6
Network / Best way to map clients with a Selector.
« on: June 16, 2010, 07:53:20 pm »
Thanks just asked to be sure.

7
Network / Best way to map clients with a Selector.
« on: June 16, 2010, 07:18:17 pm »
Thanks :)
Wasted half a day to do the impossible, I should ask earlier.  :oops:

Edit:
How can I check count of socket that selector contains?
Edit2:
How can I check if selector contains given socket?

8
Network / Best way to map clients with a Selector.
« on: June 16, 2010, 06:41:18 pm »
Hi,
I cant get std::map to work with selector

Heres server code:
http://www.copypastecode.com/31020/
Client code:
http://www.copypastecode.com/31024/
(for tests just std::cin before disconnect to prevent client from disconnection and packet sending can be deleted)

Now my problem:
Lets say we connect 100 clients TC (connMap.size()) will be 100 after closing all clients TC will be 37 and it should be 0. Whats going on?

It looks like the selector dont execute the disconnection part for sockets connected after 63.

9
General / [SOLVED] SFML 1.6 static library errors
« on: May 10, 2010, 01:14:42 pm »
Ive removed the old one from C::B and extracted the new in to the same directory.
After that in C::B compiler options check C++ compiler and linker for dynamic libs, both should be set to "mingw32-g++.exe".

10
Network / [SOLVED] SFML 1.6 VC++ SocketTCP::Connect
« on: April 13, 2010, 03:58:27 pm »
Thanks again  :D
Ive linked -s-d to Debug config, and -s to Relase config. Both are working.

11
Network / [SOLVED] SFML 1.6 VC++ SocketTCP::Connect
« on: April 13, 2010, 03:33:48 pm »
Im using sfml-network-s.lib only.
I have two releases and for mingw connect works.

12
Network / [SOLVED] SFML 1.6 VC++ SocketTCP::Connect
« on: April 13, 2010, 03:20:29 pm »
I have another problem  :)

Cant get SocketTCP::Connect to work under VisualStudio2008.
After linking program startsup and when he call Connect function i have something like that:
http://zapodaj.net/0f0481fada1e.png.html
Continue button sems to be endless loop.

Heres my code (VS Win32 Console App project):
Code: [Select]
#include "stdafx.h"
#include <SFML/Network.hpp>


int _tmain(int argc, _TCHAR* argv[])
{
sf::SocketTCP Client;
if (Client.Connect(4567, "192.168.0.2") != sf::Socket::Done)
{
// Error...
}
return 0;
}


SFML 1.6 for VisualStudio2008 (static)

13
General / [SOLVED] SFML 1.6 static library errors
« on: April 12, 2010, 12:17:15 am »
Got it to work.
gcc 4.4 from tutorial works after i reinstaled C::B and removed its old settings.

Thanks for fast reply.

14
General / [SOLVED] SFML 1.6 static library errors
« on: April 11, 2010, 11:38:26 pm »
Ok i've used TDM/MinGW Installer 1.908.0.
I have mingw32-gcc <TDM-2 mingw32> 4.4.1

Now theres only 20 errors:
http://www.copypastecode.com/26252/

Ive tried to use gcc 4.4 from tutorials with no results.

In code blocks  settings i have:
C++ compiler: mingw32-g++.exe (also 4.4.1)
Linker for dynamic libs: mingw32-g++.exe
Linker for static libs: ar.exe

I think i need some more help  :oops:

15
General / [SOLVED] SFML 1.6 static library errors
« on: April 11, 2010, 09:43:23 pm »
Hi

I cant get to work SFML 1.6 static librarys, dynamic version works.

Some details:
WinXP Proff. SP3
Code::Blocks 8.02
MinGW 5.1.6

Linker:
-lsfml-network-s

Code: [Select]
#include <SFML/Network.hpp>
using namespace std;
int main()
{
    sf::SocketTCP sock;
    sock.IsValid();
    return 0;
}


Errors:
http://www.copypastecode.com/26241/

Pages: [1] 2