BHSPitMonkey / angular-net-sockets

Angular.js module providing a TCP/UDP socket wrapper for Chrome apps, Firefox apps, and Node-Webkit.
4 stars 2 forks source link

NetSocket is undefined #2

Open AviFix opened 9 years ago

AviFix commented 9 years ago

Hi

I always get the NetSocket as undefined

i tried with google chrome and with firefox.

var app = angular.module('app', ['ngRoute','stepheneisenhauer.netsockets']);

app.controller('mainController', ['$scope','tcpservice', function ($scope,tcpservice) { tcpservice.connect('192.168.50.51',502); }]);

app.factory('tcpservice', function(NetSocket) { var socket = new NetSocket({ protocol: "tcp", onCreate: function(data){ console.log('onCreate') }, onConnect: function(data){ console.log('onConnect') }, onReceive: function(data){ console.log('onReceive') }, onSend: function(data){ console.log('onSend') }, onError: function(data){ console.log('onError') }, onDisconnect: function(data){ console.log('onDisconnect') }, onClose: function(data){ console.log('onClose') } });

Thanks allot

Avi

BHSPitMonkey commented 9 years ago

Is this within the context of a "Packaged App", and, if so, do you have the appropriate permissions declared in your app's manifest? (See: Chrome, Firefox)

AviFix commented 9 years ago

Hi,

Thanks for your response.

i just added the above code to an basic angular project.

is there something else i should do?

Thank's Avi

itskashi commented 9 years ago

@AviFix Are you able to get the NetSocket working??

simar7777 commented 7 years ago

Hi, I am facing the same issue , have placed the manifest.json in the folder where net-socket.js but still i am getting the same error " Netsocket" undefined

BHSPitMonkey commented 7 years ago

I'm afraid I haven't used this project or even Angular at all in a few years, so I probably won't be of much help. Keep in mind that the underlying socket APIs are not available outside of a packaged application context like a Chrome App (a platform now being discontinued), Firefox OS (a dead platform), or NodeJS via something like Electron. There's not much of a point in trying to support all three anymore, in my opinion.

simar7777 commented 7 years ago

Thanks and have used Nw.js it server the purpose at client side though