Skip to content

Cordova sample for receving tcp message #66

Description

@mustafasa

In ios/android was able to send message on tcp through this code ,
window.tlantic.plugins.socket.connect(
function (connectionId) {
alert('worked! This is the connection ID: ', connectionId);
window.tlantic.plugins.socket.send(function () {},function () {alert('failed!');},'192.168.1.95:53372','This is the data i want to send!');
},

function () {
alert('failed!');
},
'192.168.1.95',
53372
)
document.addEventListener(window.tlantic.plugins.socket.receiveHookName, function (ev) {
console.log(ev.metadata.host); // host who sent the data
console.log(ev.metadata.port); // sender port
console.log(ev.metadata.id); // connection id
console.log (ev.metadata.data); // received data
});
but i couldn't get any response back from TCP socket .It will be really appreciate if you could provide a sample for receiving socket thanking you :)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions