Giter Club home page Giter Club logo

cdv-socket-plugin's People

Contributors

felipekm avatar vinnylinck avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cdv-socket-plugin's Issues

Add Support for BlackBerry 10

Hi Vinny and Felipe,
I'm the coordinator of the BlackBerry Tech Center Brazil and I'm developing the support of BlackBerry 10 socket into your plugin and I wish to send you a pull request when I finish it. Do you have interest on that?

Thank,
Leandro.

single quotes problem

Hi, i have problem with the function call receivehook;
I have a server w/c i have no way of editing the response and im stuck with the single quotes problem, here is a sample response and call:

window.tlantic.plugins.socket.receive('192.168.43.151',8017,'192.168.43.151:8017','{"Type":"status","IsPlaying":true,"IsPaused":false,"IsPlayerOnTop":false,"Title":"Now That You're Gone","CurrentModule":"Music/shares","SelectedItem":"12. Juris Fernandez - Now That You're Gone","WindowId":501}');

Connection ID return

The result of connect method should be a string containing the "connection id" instead of a message, which is useless.

Cannot connect to host!

I try to establish a connection between an iOS 8 device and an Android 4.4 device and at first I get the message: Established connection with 192.168.178.20:18002

Few milliseconds later I get «Cannot connect to the host!».

The network is up, no firewall, etc. Is there a way to get a more detailed Error-Message?

Make socket buffer length configurable

The buffer size has to be a socket channel configuration, avoiding undesirable data truncation/chopping when receiving data from the server.

The original issue (#32) refers to iOS but it must to be checked in all platforms.

Improve socket operations

Currently, socket operations require host and port. This can be improved. After connect operation, it should return the connection id to make easier future socket operations.

iOS - Connection Pool is not being properly disposed when DisposeConnection

It shouldn't set Null to the pool since there is no connections inside of it?

My suggestion is to test if the Connection Pool count is Zero and if it's true set null to it, cause every time you invoke Connect it's checking if the Pool is null and if it's true it init the pool.

if ([pool count] == 0) {
pool = nil;
}

Make sense?

Not connecting to the server (usually I use telnet client to connect)

Hi,

Maybe I'm wrong but I tried to connect to a server with this plugin without success.

Usually on windows I use the Telnet client to connect and send commands to the server.

I tried the client sample but I have connection issues and I can't sent messages.

Am I doing something wrong ?

Thanks a lot,

Kreshnik

PS :
IP : "192.168.211.130"
Port : 5007

Backslashes Properly Escaped?

Hey I'm back again :) Very Thankful for that fix last release it was brilliant, This plugin is getting more and more better. Though i do have some pretty weird behavior i encountered not sure if it was only me, but might need you to check and test if plugin works with this kind of return:

{
"Type":"nowplaying",
"Duration":2458,
"Position":0,
"IsTv":false,
"IsFullscreen":true,
"File":"",
"MediaInfo":{
"MediaType":"series",
"SeriesId":76290,
"SeasonId":10063,
"EpisodeId":189255,
"Series":"24",
"Season":1,
"Episode":1,
"Title":"Tag 1: 00:00Uhr-01:00Uhr",
"AirDate":"2001-11-06",
"Director":"Stephen Hopkins",
"Writer":"Robert Cochran, Joel Surnow",
"Genre":"|Action and Adventure|Drama|",
"ImageName":"c:\images\series\24.jpg",
"MyRating":"",
"Plot":"Stressiger Abend f\U00fcr CTU-Agent Jack Bauer: Seine halbw\U00fcchsige Tochter Kimberly stiehlt sich unerlaubt aus dem Haus. Aber bevor er sich auf die Suche machen kann, wird er dringend ins B\U00fcro zitiert, denn Terroristen planen einen Anschlag auf Senator David Palmer. Es scheint eine lange Nacht f\U00fcr den Agenten zu werden…",
"Rating":"7.5",
"RatingCount":"",
"Status":"Ended"
}
}

NSStreamEventOpenCompleted

Use NSStreamEventOpenCompleted event to save connection into the pool. That helps to fix the problem about saving trash into connection pool.

Add support for WP8

Add support for Windows Phone 8 platform covering same features implemented for iOS and Android on previous versions.

If possible, try to reuse W8 code.

Dual license conceivable?

IMHO your plugin forces all applications that uses it to be licensed under GPL as well. And I'm not sure if they will ever be accepted by Apple on submission. Any chance to make the plugin dual license?

Android - Binary data support (send only)

This is related to issue #53 where the same was requested for iOS.

(I don't know if the user who raised that issue also wanted receive support, but in my application I only need to send binary data).

I propose addition of a new method:

sendBinary(successCallback, errorCallback, connectionId, data)

In this case data is a JSONArray, one byte per element, so it may be called as follows:

window.tlantic.plugins.socket.sendBinary(
  function() {
    console.log('sent')
  },
  function(error) {
    console.log('failed to send: '+error)
  },
  connectionId,
  [ 0x01, 0x00, 0x01, 0xFD ]
);

Multiple locks on web thread not allowed!

When running out of resources (memory, cpu) the plugin exposes multiple locks on web view, throwing bool_WebTryThreadLock(bool) exceptions.

This exception put the application in a starving scenario, with no answer from plugin.

NSStreamEventEndEncountered:

through this event, iOS plugin must to clean connection pool because the server or other external condition decide to terminate the connection itself.

Use connection ID to perform operations

Instead of following POC approach, the operations over a connection (send, disconnect, etc..) will use the connection id as reference instead of host and port every time something must be done.

Expose connection status information

From javascript code there is no access to connection status. Need to expose socket.isConnected or other similar information to have JS code able to take decisions about TCP socket management.

can't receive data util disconnect(android 4.4)

connected to some server, server sent some data to android app, but the “SOCKET_RECEIVE_DATA_HOOK” event won't trigger util a disconnection is made by server / cdv-socket-plugin. I use the android v19 sdk. Is this caused by the android API difference between versions?

Android connection check

Android isConnected is not assertive when checking socket connection. We need to improve the connection check to provide a mechanism for apps checking the connections status.

Handle JSON objects

The current implementation works only with String objects. Would be nice having the plugin JS file verifying the object type before sending/receiving data, calling JSON.stringify and JSON.parse when needed.

Readme Issue

The 'Send' example on readme is differently if compared with the implementation in www/Socket.js:
send (successCallback, errorCallback, host, port, data)

Should be "send (successCallback, errorCallback, connectionId, data)" as is on socket.js line 31;

Also there's a silent bug as you can see on the other sample functions, the IP is such this: '192.168.2..5', with two dots after the number 2.

Add basic support for W8

Add support for Windows 8 Store Apps platform covering same features implemented for iOS and Android on previous versions.

iOS - binary data support

It seems that binary communication is not supported, looking at -[Connection write:] and -[Connection stream:(NSStream*) handleEvent:(NSStreamEvent)], where NSASCIIStringEncoding is used. Is it so? In this case, would it be possible to add binary data support?

NSStreamEventErrorOccurred

Handle NSStreamEventErrorOccurred event to clean connection pool and release resources if something bad happens. Maybe we can think about a new feature to establish connection in this case.

Variable Name Conflict

There's is a variable name conflict on Connection.m file on the Write Method, the var Chunk is conflicting with other variable with the same name, the other one is declared on connection.h file.

Need to change the name of some of these.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.