arduino / arduino/Arduino

Support network protocols that require server to send data before client e.g. VNC [imported]

Open
#186 0 comments 0 reactions 1 assignee Claimed by @cmaglie View on GitHub
feature request Library: Ethernet
Dominant language
Java
Stars
14.6k
Forks
7k
PR merge metrics
No merged PRs in 30d

Description

This is [Issue 186](http://code.google.com/p/arduino/issues/detail?id=186) moved from a Google Code project.
Added by 2010-01-15T02:09:24.000Z by [follower@gmail.com](http://code.google.com/u/follower@gmail.com/).
Please review that bug for more context and additional comments, but update this bug.

Original labels: Type-Enhancement, Priority-Medium
### Original description

What change would you like to see?

Add a '.connected()' method to 'Server' which returns connected clients without consideration for
whether they have data available (which '.available()' does).

**Why?**

At present it is not possible to implement a network protocol which requires the server to send
data when the client connects but before the client sends data. VNC is an example of such a
protocol. As is a telnet server which wished to send a banner on connection.

**Would this cause any incompatibilities with previous versions? If so, how**
**can these be mitigated?**

Adding this method with the attached patch shouldn't cause incompatibilities unless someone
has extended the Server class with a 'connected()' method themselves.

The implementation of the supplied patch is not ideal however as it simply duplicates most of the
code in 'available()'. Ideally one method should call the other with some flag that indicates a
check should be made for data available. Changing the implementation of 'available()' in this
manner would increase the possibility of accidental incompatibilities but should lead to a "more
maintainable" implementation.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.