-
SuperSockets [C#] Hold up to 10K connections.
! UPDATED Download: Pack.rar
Information
SocketListener using async, events and pooling. (Very Stable)
Read the 'README' :)
Credits
50% Microsoft (Doing examples how to create)
50% Me (Doing te codes)
Example(s)
Pooling
Code:
internal SocketAsyncEventArgs Pop()
{
lock (this.Pool)
{
return this.Pool.Pop();
}
}
internal void Push(SocketAsyncEventArgs item)
{
lock (this.Pool)
{
this.Pool.Push(item);
}
}
Async Accepting
Code:
private static void WaitForAsync(SocketAsyncEventArgs Args)
{
if (Args == null)
{
Args = new SocketAsyncEventArgs();
Args.Completed += new EventHandler<SocketAsyncEventArgs>(AcceptAsync_Completed);
}
else
{
Args.AcceptSocket = null;
}
SocketSemaphore.WaitOne();
BaseSocket.AcceptAsync(Args);
}
private static void HandleAsync(SocketAsyncEventArgs Args)
{
try
{
Interlocked.Increment(ref ConnectedAmount);
var SingleSocketAsync = SocketPool.Pop();
var Token = (AsyncUserToken)SingleSocketAsync.UserToken;
Token.Socket = Args.AcceptSocket;
var Session = new Session(Interlocked.Increment(ref Counter), Token.Socket, Args);
Sessions.Add(Session.Id, Session);
if (!Args.AcceptSocket.ReceiveAsync(SingleSocketAsync))
{
HandleReceive(SingleSocketAsync);
}
}
catch { }
finally { WaitForAsync(Args); }
}
Like if you like!
I use this in (Boolean) : http://forum.ragezone.com/f331/proje...63a-os-808457/
-
Re: SocketListener + Sockets C# [Events, Async, Fast, Hard]
Well done Wichard, not bad!!! and guys, SocketAsyncEvents is what REALLY holds 10k+ connections in C#
Why you still using internal btw, do you know what that actually does?
EDIT: Took a quick look, im sad :(, your not doing it all correctly your missing a few very important things, your not allocated the buffer at startup so its all in the same memory space (the buffer space is handed out to clients on read/write request, it doesn't create a buffer for each use, acts like a buffer pool)
EDIT 2: Why don't you just make use of SuperSocket? It does everything else for you, just import the project solution into your project as dependencies then use it :D
Otherwise look here:
http://www.codeproject.com/KB/IP/soc...eventargs.aspx
-
Re: SocketListener + Sockets C# [Events, Async, Fast, Hard]
Quote:
Originally Posted by
matty13
Well done Wichard, not bad!!! and guys, SocketAsyncEvents is what REALLY holds 10k+ connections in C#
Why you still using internal btw, do you know what that actually does?
EDIT: Took a quick look, im sad :(, your not doing it all correctly your missing a few very important things, your not allocated the buffer at startup so its all in the same memory space (the buffer space is handed out to clients on read/write request, it doesn't create a buffer for each use, acts like a buffer pool)
You should help me: wichardriezebos@live.nl
-
Re: SocketListener + Sockets C# [Events, Async, Fast, Hard]
Quote:
Originally Posted by
Squard
Already got you on msn but your not online to me.
-
Re: SocketListener + Sockets C# [Events, Async, Fast, Hard]
I finished the BufferManager.
Quote:
Originally Posted by
matty13
Already got you on msn but your not online to me.
With BufferManager: Transmission.rar
Very stable ;D
-
Ooh, thanks. Now the users who buy my emulator wont complain about a limit of 5k :/
Sent from my mobile via Tapatalk.
-
Re: SuperSockets [C#] Hold up to 10K connections.
Got to say its looking really good.
-
Re: SuperSockets [C#] Hold up to 10K connections.
Quote:
Originally Posted by
-Jordan-
Got to say its looking really good.
Thanks :D
-
Re: SuperSockets [C#] Hold up to 10K connections.
I read this thread and truly had a long, ever lasting giggle. Let's hit 300 online before we start worrying about 10,000 online mk?
-
Re: SuperSockets [C#] Hold up to 10K connections.
So, i can now hit up 10.000 players? =D
-
Re: SuperSockets [C#] Hold up to 10K connections.
This is awesome, Thanks mate :)
-
Re: SuperSockets [C#] Hold up to 10K connections.
Quote:
Originally Posted by
Muscab
I read this thread and truly had a long, ever lasting giggle. Let's hit 300 online before we start worrying about 10,000 online mk?
Actually, agreed.
This socket will be fine for people that's making their own MMOCC. Having great dedicated servers, and super sockets. But on Habbo Retro's is it almost not reachable.
Habbo NL - Almost 6k players at a day
Habbo COM - 10k
So, how the fuck would a Retro Hotel reach 10k players? i don't know.
-
Quote:
Originally Posted by
MerijnZ
So, i can now hit up 10.000 players? =D
Think about your Mysql Query's etc too!
Posted via Mobile Device
-
Re: SuperSockets [C#] Hold up to 10K connections.
Quote:
Originally Posted by
Muscab
I read this thread and truly had a long, ever lasting giggle. Let's hit 300 online before we start worrying about 10,000 online mk?
We're talking about huge amounts. Matty said up to 10K so i believe an more experienced coder.
Quote:
Originally Posted by
Emerica
Think about your Mysql Query's etc too!
Posted via Mobile Device
Thats all to you. Some dumbs like: Meth0d created his own Pooling.
MySQLConnector includes his own pooling thats very better. Using MySQLHelper.
-
Re: SuperSockets [C#] Hold up to 10K connections.
It's the actual mysql server that processes all the queries. The emulator tells to server to process these queries. :)
So if you get alot of lag from running too much queries, it's the mysql server, not the emulator.
-
Re: SuperSockets [C#] Hold up to 10K connections.
Quote:
Originally Posted by
Quackster
It's the actual mysql server that processes all the queries. The emulator tells to server to process these queries. :)
So if you get alot of lag from running too much queries, it's the mysql server, not the emulator.
Theoretically, anything is possible.
-
Re: SuperSockets [C#] Hold up to 10K connections.
Quote:
Originally Posted by
MerijnZ
Actually, agreed.
This socket will be fine for people that's making their own MMOCC. Having great dedicated servers, and super sockets. But on Habbo Retro's is it almost not reachable.
Habbo NL - Almost 6k players at a day
Habbo COM - 10k
So, how the fuck would a Retro Hotel reach 10k players? i don't know.
Habbo Principal - Nearly 40k players a day. 10k is reachable but not at this day in age. Maybe 2 years or so, as already we see hotels like Sunnieday getting nearly 3000 daily.
But like this - it supports 10k connections for when needed, it is better to code it for large numbers of connections as it would not need re-coding when your hotel expands.
-
Re: SuperSockets [C#] Hold up to 10K connections.
Quote:
Originally Posted by
Davidaap
your believing that sunniedays online count is 100% real? ;)
A lot of people? Tim is just an faggot.
-
Re: SuperSockets [C#] Hold up to 10K connections.
Anyone tested those sockets? Yes they are functionally. but i mean tested on high amount(s).
-
Re: SuperSockets [C#] Hold up to 10K connections.
Quote:
Originally Posted by
MyKi
Wanna know something funny, well not 'funny' but eh, some hotels like German Hotels they get like 6, 000 users on line, if there lucky, and no they don't run on Phoenix Emulator, no they don't run on Butterfly or anything else like that, they actually run on there own UberEdit server, and it's very stable. And I mean very stable! All the games work, all the pets work (not horses) and you know, it goes to show, if you do take effort into making or editing an emulator, you can achieve a great goal.
But people who sell emulators closed source, like Aaron, and whoever else, are just pricks who are tr0lls looking for cash for there shit-ass UBER edits! And I remember, a few years ago, we had some great coders, but the section has fallen apart, and all we have is like 3-4-5 actually good coders, it's really sad to see this happen. Now-a days everyone who develops things prefer to keep it to themselves because there afraid that people would say shit about there work like it's crap, it's sad really, because when someone releases something, there releasing it so that YOU can use it, or in hope that it's useful for some, or all.
So I personally think that this section needs a big clean-up, I'm just saying. Because if someone goes to release something, and one person doesn't like it, the'll give all this negative comments, but remember, this is a development section, Habbo Hotel section, Help section, Tutorial section, everyone is just trying to help out, even if it's the littlest bit.
It would be great if people showed at lease some consideration about others in this section. It's really sad to see what has developed over time. We really need to start to act like our age, not 10 year old trolls trying to get a epenis or anything like that, we should appreciate for what we have! / Thank you for reading, much appreciated.
-MyKi
Who are you? You registered last month. You have no idea what you are talking about.
-
Re: SuperSockets [C#] Hold up to 10K connections.
Quote:
Originally Posted by
Squard
Anyone tested those sockets? Yes they are functionally. but i mean tested on high amount(s).
Its a step forward but the code isn't 100% complete, there is still tons missing from it at moment :)
-
Re: SuperSockets [C#] Hold up to 10K connections.
Quote:
Originally Posted by
matty13
Its a step forward but the code isn't 100% complete, there is still tons missing from it at moment :)
What are you missing ?
-
Re: SuperSockets [C#] Hold up to 10K connections.
Perhaps 1000 users max (and 1000 is probably pushing it) on good hardware and code (e.g. Netty). Anything after that, i'd imagine you'd have to load-balance and route to several server instances and SQL clusters.
-
Re: SuperSockets [C#] Hold up to 10K connections.
Quote:
Originally Posted by
office.boy
Perhaps 1000 users max (and 1000 is probably pushing it) on good hardware and code (e.g. Netty). Anything after that, i'd imagine you'd have to load-balance and route to several server instances and SQL clusters.
I heard netty is java. This is not java my friend.
-
Quote:
Originally Posted by
Squard
I heard netty is java. This is not java my friend.
Mike was using netty as an example...
Posted via Mobile Device