Author Topic: WZ5500  (Read 1640 times)

0 Members and 1 Guest are viewing this topic.

Offline S. PetrukhinTopic starter

  • Super Contributor
  • ***
  • Posts: 1273
  • Country: ru
WZ5500
« on: February 08, 2021, 11:56:01 am »
Hello, friends!

Who has experience using the WZ5500, please tell me, is this chip capable of opening connections with the same port on several sockets?
If I configure 2 or more sockets to listen on the same port, how does it distribute requests from different IP addresses?
And sorry for my English.
 

Online nctnico

  • Super Contributor
  • ***
  • Posts: 27480
  • Country: nl
    • NCT Developments
Re: WZ5500
« Reply #1 on: February 08, 2021, 03:10:01 pm »
Hello, friends!

Who has experience using the WZ5500, please tell me, is this chip capable of opening connections with the same port on several sockets?
If I configure 2 or more sockets to listen on the same port, how does it distribute requests from different IP addresses?
In general: You can't. A port can only be handled by one socket.
There are small lies, big lies and then there is what is on the screen of your oscilloscope.
 

Offline S. PetrukhinTopic starter

  • Super Contributor
  • ***
  • Posts: 1273
  • Country: ru
Re: WZ5500
« Reply #2 on: February 08, 2021, 04:10:59 pm »
Hello, friends!

Who has experience using the WZ5500, please tell me, is this chip capable of opening connections with the same port on several sockets?
If I configure 2 or more sockets to listen on the same port, how does it distribute requests from different IP addresses?
In general: You can't. A port can only be handled by one socket.

It's sad... A small web server will not work on it...  |O
And sorry for my English.
 

Online nctnico

  • Super Contributor
  • ***
  • Posts: 27480
  • Country: nl
    • NCT Developments
Re: WZ5500
« Reply #3 on: February 08, 2021, 04:17:29 pm »
Hello, friends!

Who has experience using the WZ5500, please tell me, is this chip capable of opening connections with the same port on several sockets?
If I configure 2 or more sockets to listen on the same port, how does it distribute requests from different IP addresses?
In general: You can't. A port can only be handled by one socket.

It's sad... A small web server will not work on it...  |O
Ofcourse it will. The way it works that each connection get's in own socket at the time it comes in and the connection will be handled on that (new) socket while the original socket keeps listening for new incoming connections. Just look for out a basic (multi client) telnet server example.
There are small lies, big lies and then there is what is on the screen of your oscilloscope.
 

Offline S. PetrukhinTopic starter

  • Super Contributor
  • ***
  • Posts: 1273
  • Country: ru
Re: WZ5500
« Reply #4 on: February 08, 2021, 04:46:07 pm »
You just wrote:

In general: You can't. A port can only be handled by one socket.

 :-//
And sorry for my English.
 

Offline ejeffrey

  • Super Contributor
  • ***
  • Posts: 3828
  • Country: us
Re: WZ5500
« Reply #5 on: February 08, 2021, 09:13:34 pm »
Hello, friends!

Who has experience using the WZ5500, please tell me, is this chip capable of opening connections with the same port on several sockets?
If I configure 2 or more sockets to listen on the same port, how does it distribute requests from different IP addresses?

Yes.  If you configure two or more sockets to listen on the same port they will both work.  Incoming connections will be assigned to the first available socket.  If they are all full, the client will get a connection refused error.
« Last Edit: February 08, 2021, 09:16:28 pm by ejeffrey »
 
The following users thanked this post: S. Petrukhin

Offline S. PetrukhinTopic starter

  • Super Contributor
  • ***
  • Posts: 1273
  • Country: ru
Re: WZ5500
« Reply #6 on: February 08, 2021, 09:19:37 pm »
Hello, friends!

Who has experience using the WZ5500, please tell me, is this chip capable of opening connections with the same port on several sockets?
If I configure 2 or more sockets to listen on the same port, how does it distribute requests from different IP addresses?

Yes.  If you configure two or more sockets to listen on the same port they will both work.  Incoming connections will be assigned to the first available socket.  If they are all full, the client will get a connection refused error.

Thank you, Ejeffrey!  :-+
And sorry for my English.
 

Offline ejeffrey

  • Super Contributor
  • ***
  • Posts: 3828
  • Country: us
Re: WZ5500
« Reply #7 on: February 08, 2021, 09:20:20 pm »
Hello, friends!

Who has experience using the WZ5500, please tell me, is this chip capable of opening connections with the same port on several sockets?
If I configure 2 or more sockets to listen on the same port, how does it distribute requests from different IP addresses?
In general: You can't. A port can only be handled by one socket.

It's sad... A small web server will not work on it...  |O
Ofcourse it will. The way it works that each connection get's in own socket at the time it comes in and the connection will be handled on that (new) socket while the original socket keeps listening for new incoming connections. Just look for out a basic (multi client) telnet server example.

This is not how the wiznet API works.  They have an API that is similar to but not the same as berkley sockets.

They do not have a separation between "listen" and "accept" sockets.  Rather, you configure a socket in listen mode.  When a connection comes in, the listen socket transitions to the accepted state and you use it to communicate.  It does not allocate a new socket the way normal listening sockets work. Once the connection ends you put the socket back into listen mode to wait for the next connection. In order to allow multiple simultaneous connections you need to put multiple sockets in the listen state.
 

Online nctnico

  • Super Contributor
  • ***
  • Posts: 27480
  • Country: nl
    • NCT Developments
Re: WZ5500
« Reply #8 on: February 09, 2021, 12:53:17 am »
Aha. That is different to the normal way (Berkley) sockets work indeed.
There are small lies, big lies and then there is what is on the screen of your oscilloscope.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf