Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-26195] Parity: Ti.Network.Socket.UDP API differs significantly from Ti.Network.Socket.TCP API

GitHub Issuen/a
TypeBug
PriorityMedium
StatusOpen
ResolutionUnresolved
Affected Version/sn/a
Fix Version/sn/a
ComponentsAndroid, TiAPI, Windows
LabelsengArch, parity
ReporterChristopher Williams
AssigneeUnknown
Created2018-07-10T19:25:27.000+0000
Updated2019-11-23T15:08:27.000+0000

Description

The Ti.Network.Socket.TCP and Ti.Network.Socket.UDP APIs should be as similar as we can possibly achieve. However they differ significantly at the most basic levels. Specifically: - TCP uses properties to set host/port then calls #listen() and #accept(), UDP uses #start(port, [host]) for starting a local socket - TCP uses #close(), UDP uses #stop() to tear down the socket - TCP uses properties to set host/port then calls #connect(), it's unclear to me how UDP handles connecting/sending data to a remote socket as a client. - TCP has callbacks for accepted/connected (server got a connection, connected as a client); UDP has started/data (socket bound, socket received data). - The properties/callbacks differ in naming of common properties, i.e. port is the same, but TCP uses host while UDP uses address. - TCP forces you to use IOStream read/write methods (using Ti.Buffer); UDP has special methods for writing bytes (as Number[]) and Strings.

Comments

  1. Raymond Verbruggen 2019-11-23

    This would help a lot for iOS and Android. The Ti.UDP module is not supported by SDK 7/8....

JSON Source