c# - Install System.Net.Sockets on xamarin forms pcl -
i have problem. need use tcpclient on xamarin forms, "system.net.sockets" won't install. can not use nuget install it.
the error is.:
could not install package 'system.net.sockets 4.3.0'. trying install package project targets '.netportable,version=v4.6,profile=profile44', package not contain assembly references or content files compatible framework. more information, contact package author.
on ios , android projects able install, on portable project won't install.
how solve problem ?
thanks
you should try this plugin
a tpc listner
var listenport = 11000; var listener = new tcpsocketlistener(); // when connections, read byte-by-byte socket's read stream listener.connectionreceived += async (sender, args) => { var client = args.socketclient; var bytesread = -1; var buf = new byte[1]; while (bytesread != 0) { bytesread = await args.socketclient.readstream.readasync(buf, 0, 1); if (bytesread > 0) debug.write(buf[0]); } }; // bind listen port across interfaces await listener.startlisteningasync(listenport);
otherwise can try implement socket in platform specific code..
Comments
Post a Comment