Jump to content


Photo

Winsock 1.2.5.0: Fixed Client List


  • Please log in to reply
25 replies to this topic

#1 h0bbel

h0bbel

    GMC Member

  • New Member
  • 252 posts

Posted 24 May 2007 - 05:56 AM

<p>This DLL allows you to communicate from a server to multiple clients.<br />
<br />
The part of the DLL that accepts incoming connections is threaded so your server does not freeze waiting for clients.<br />
<br />
It also has threaded file transmission which allows you to send a file from server to client or from client to server without freezing your game.<br />
<br />
Example screenshot:<br />
(link removed)</p>
<p><br />
The next feature I'm planning to add is buffering; fill up a buffer with multiple strings and integers and then send it.<br />
This would decrease the number of sended packets and that would make it much faster.<br />
<br />
(link removed)</p>
<p><br />
<strong class="bbc">Version 1.1.0.0</strong><br />
<br />
Buffering is a method which dramatically increases the speed of your communication.<br />
Every time you send with the normal integer/string functions a new packet is sended.<br />
Sending much packets decreases the speed because they contain much information which costs you bandwith.<br />
When you send with buffering you have all the integers and strings grouped together.<br />
<br />
This is how a buffer of this DLL looks like:<br />
<br />
wsockhexbuffer.png<br />
<br />
The example buffer is created with the following code:<br />
<br />
Sock_NewBuffer ();<br />
Sock_BufferAddString (&quot;String&quot;,6);<br />
Sock_BufferAddInteger (300,4);<br />
Sock_BufferAddDouble (12.12,8);<br />
<br />
<strong class="bbc">Version 1.2.0.0</strong><br />
This version comes with functions to limit the upload speed of the threaded file transfer functions.<br />
<br />
<strong class="bbc">Version 1.2.5.0</strong><br />
This version includes two new functions to get actual client numbers.<br />
The previous version reorganized the client numbers when a client was removed, causing client numbers to change.<br />
The client number of a certain client stays the same for the whole session in version 1.2.5.0.<br />
<br />
Example: ( Old version )<br />
Client 1 connects and has client number 1.<br />
Client 2 connects and has client number 2.<br />
<br />
Client 1 disconnects and the server removes the client using Sock_RemoveClient (1).<br />
The client list is reorganized and client 2 automatically gets client number 1.<br />
This is very confusing, because client 2 gets data originally meant for client 1.<br />
<br />
The new version works this way:<br />
Client 1 disconnects.<br />
The server calls Sock_GetActClients, which tells the server there's one client connected.<br />
The server calls Sock_GetActClient (1) to get the client number of the connected client and the function returns 2.<br />
As you can see, client 2 still has client number 2 so it gets the data which was meant for him and not for client 1.</p>

Edited by h0bbel, 19 September 2013 - 06:55 PM.

  • 0
The empty archive bug should be fixed on my site.
Please use the "report bug" button on my site to report bugs, makes things clearer.

#2 callum

callum

    GMC Member

  • New Member
  • 176 posts

Posted 24 May 2007 - 09:21 AM

this is a excelent dll

nice an simple to use
  • 0
Extensions: EditBox

#3 novaz

novaz

    GMC Member

  • GMC Member
  • 592 posts
  • Version:Unknown

Posted 24 May 2007 - 02:31 PM

thanks, really a great work, hobbel :medieval:

do you think it's possible to set the upload speed? the problem is
that if you're playing the game the server can have problems if the
upload is too fast.
  • 0

#4 oakwhiz

oakwhiz

    GMC Member

  • New Member
  • 268 posts

Posted 24 May 2007 - 03:44 PM

Don't you mean 'threaded'?

An interesting DLL, but right now I'm using 39dll.
  • 0

#5 Meiun

Meiun

    GMC Member

  • New Member
  • 248 posts

Posted 24 May 2007 - 03:44 PM

Looks cool. Although I believe you meant "threaded" rather than "treaded." Aside from that, looks great, i'm anxious to see some new updates to this DLL. It also wouldn't hurt to add some documentation (even though it is fairly straight forward to figure out for the most part).
  • 0

#6 h0bbel

h0bbel

    GMC Member

  • New Member
  • 252 posts

Posted 24 May 2007 - 04:29 PM

Don't you mean 'threaded'?

Typical typo of me :)

It also wouldn't hurt to add some documentation (even though it is fairly straight forward to figure out for the most part).

The documentation is included now. (forgot)
  • 0
The empty archive bug should be fixed on my site.
Please use the "report bug" button on my site to report bugs, makes things clearer.

#7 BlaXun

BlaXun

    Slime Online Creator

  • GMC Member
  • 2750 posts
  • Version:GM:Studio

Posted 24 May 2007 - 04:32 PM

sounds good...but I'd also like to be able to set an upload limit!
  • 0

iBNKRoX.png


#8 h0bbel

h0bbel

    GMC Member

  • New Member
  • 252 posts

Posted 24 May 2007 - 05:52 PM

Hmm ...

I cannot limit the upload speed in the current method because the user data is send right away after calling the function.

But when I create the new buffering method it is possible, because that data can be controlled, I can split the buffer up into parts when the ready-to-send data hits the limit per second, and send it the next second.

I hope you are aware of the fact that the data is delivered to late when limited and that a big time difference between server and client can appear.

But still, I'll try to add the functionality of limiting the speed to the next version.

That gives me an idea, I could also make some functions to measure the current up/down speed.
  • 0
The empty archive bug should be fixed on my site.
Please use the "report bug" button on my site to report bugs, makes things clearer.

#9 h0bbel

h0bbel

    GMC Member

  • New Member
  • 252 posts

Posted 25 May 2007 - 08:28 AM

Do you need to have all functions limited by speed or just the file functions?
  • 0
The empty archive bug should be fixed on my site.
Please use the "report bug" button on my site to report bugs, makes things clearer.

#10 novaz

novaz

    GMC Member

  • GMC Member
  • 592 posts
  • Version:Unknown

Posted 25 May 2007 - 08:43 AM

i think it's good enough to limit the download and upload speed. It would
be good for example if the server can send 3 files to 3 players at 5k/s.
When the game starts for example the server can send maps and avatars.
  • 0

#11 h0bbel

h0bbel

    GMC Member

  • New Member
  • 252 posts

Posted 27 May 2007 - 09:35 AM

The 1.1.0.0 version is released.
The next thing I will add is the possibility to limit the file transmission upload speed.

Edited by h0bbel, 27 May 2007 - 09:35 AM.

  • 0
The empty archive bug should be fixed on my site.
Please use the "report bug" button on my site to report bugs, makes things clearer.

#12 BlaXun

BlaXun

    Slime Online Creator

  • GMC Member
  • 2750 posts
  • Version:GM:Studio

Posted 27 May 2007 - 01:19 PM

sounds very promising!
will keep an eye on this.
keep up the good work :D
  • 0

iBNKRoX.png


#13 novaz

novaz

    GMC Member

  • GMC Member
  • 592 posts
  • Version:Unknown

Posted 28 May 2007 - 07:17 PM

hi, there's an error in the server and client example.

Sock_ClientReceiveFileTreaded (FileSize,Name);

you miss the 'h' in threaded, it's

Sock_ClientReceiveFileThreaded (FileSize,Name);

thanks for your work, i hope you can release the new version :(
  • 0

#14 h0bbel

h0bbel

    GMC Member

  • New Member
  • 252 posts

Posted 29 May 2007 - 08:39 AM

Version 1.2.0.0
This version comes with functions to limit the upload speed of the threaded file transfer functions.
  • 0
The empty archive bug should be fixed on my site.
Please use the "report bug" button on my site to report bugs, makes things clearer.

#15 novaz

novaz

    GMC Member

  • GMC Member
  • 592 posts
  • Version:Unknown

Posted 29 May 2007 - 09:58 AM

great, it's fantastic. The upload speed works very well.
  • 0

#16 h0bbel

h0bbel

    GMC Member

  • New Member
  • 252 posts

Posted 29 May 2007 - 03:01 PM

great, it's fantastic. The upload speed works very well.

<{POST_SNAPBACK}>


OK
  • 0
The empty archive bug should be fixed on my site.
Please use the "report bug" button on my site to report bugs, makes things clearer.

#17 hogofwar

hogofwar

    GMC Member

  • New Member
  • 40 posts

Posted 05 June 2007 - 06:20 PM

is it possible to get "connected clients" onto the client program but instead used as "number of people using this program"
  • 0

#18 h0bbel

h0bbel

    GMC Member

  • New Member
  • 252 posts

Posted 05 June 2007 - 06:32 PM

is it possible to get "connected clients" onto the client program but instead used as "number of people using this program"

<{POST_SNAPBACK}>


To get data from other clients to a client you have to get the data from the server.
  • 0
The empty archive bug should be fixed on my site.
Please use the "report bug" button on my site to report bugs, makes things clearer.

#19 hogofwar

hogofwar

    GMC Member

  • New Member
  • 40 posts

Posted 06 June 2007 - 06:08 PM

I tried to connect to my own computer but instead of using 127.0.0.1 I hard coded my proper ip but an error came up and said it couldn't connect even though i had my server running

Then I to use 127.0.0.1 in the same way I used my proper one and it worked

What do I do to get my proper ip working?
  • 0

#20 celebraces

celebraces

    GMC Member

  • GMC Member
  • 956 posts

Posted 06 June 2007 - 10:12 PM

If you're behind a router then you're actually sending stuff to the router, not your computer. If you've forwarded ports correctly, then using it from another computer should be fine.
  • 0

#21 hogofwar

hogofwar

    GMC Member

  • New Member
  • 40 posts

Posted 07 June 2007 - 04:34 PM

forward my port to what?
  • 0

#22 h0bbel

h0bbel

    GMC Member

  • New Member
  • 252 posts

Posted 07 June 2007 - 07:07 PM

forward my port to what?

<{POST_SNAPBACK}>


I think he meant that you have to ensure your used ports are open.
You have to open ports in your router before you can use them (mostly).
To configure your router try entering your internet IP address in your browser as a website. ( like http://12.23.45.67 )
  • 0
The empty archive bug should be fixed on my site.
Please use the "report bug" button on my site to report bugs, makes things clearer.

#23 h0bbel

h0bbel

    GMC Member

  • New Member
  • 252 posts

Posted 24 June 2007 - 10:16 AM

Version 1.2.5.0
This version includes two new functions to get actual client numbers.
The previous version reorganized the client numbers when a client was removed, causing client numbers to change.
The client number of a certain client stays the same for the whole session in version 1.2.5.0.

Example: ( Old version )
Client 1 connects and has client number 1.
Client 2 connects and has client number 2.

Client 1 disconnects and the server removes the client using Sock_RemoveClient (1).
The client list is reorganized and client 2 automatically gets client number 1.
This is very confusing, because client 2 gets data originally meant for client 1.

The new version works this way:
Client 1 disconnects.
The server calls Sock_GetActClients, which tells the server there's one client connected.
The server calls Sock_GetActClient (1) to get the client number of the connected client and the function returns 2.
As you can see, client 2 still has client number 2 so it gets the data which was meant for him and not for client 1.
  • 0
The empty archive bug should be fixed on my site.
Please use the "report bug" button on my site to report bugs, makes things clearer.

#24 h0bbel

h0bbel

    GMC Member

  • New Member
  • 252 posts

Posted 24 June 2007 - 10:27 AM

See the examples.
  • 0
The empty archive bug should be fixed on my site.
Please use the "report bug" button on my site to report bugs, makes things clearer.

#25 NewDuck

NewDuck

    GMC Member

  • New Member
  • 54 posts

Posted 25 June 2007 - 07:03 PM

It looks promising, althought I could use an example for basic game communication, as I tried it myself, the first time it worked, but then i screwed up something and the client just kept freezing.
But this looks really good so far.
  • 0

#26 TheMyst

TheMyst

    GMC Member

  • New Member
  • 166 posts

Posted 29 April 2009 - 06:13 PM

I will definitely take a look at this. This seems like it could be easier than 39dll, but just as powerful.

EDIT: It's... simply too beautiful to describe. :)

Edited by TheMyst, 29 April 2009 - 06:17 PM.

  • 0
Level Editor Example: Use/Abuse as you wish.
My PC (recently upgraded): Asus P5Q SE2 Mainboard, Core 2 Quad @ 2.33 (will overclock), 4GB OCZ RAM, Onboard Sound by VIA Technologies, nVIDIA BFG 9800GTX.
My old stuff is going on Craigslist: EVGA 650i Ultra Mainboard, 2GB Ram, 2.33 Core 2 Duo (OC'd to 3.0), nVIDIA 8600 GT.
Copy and paste this into your signature if you DON'T GIVE A #$@% about religion, but nonetheless are annoyed by people who wear it like a badge.