NSNetService doesn't contain any addresses - ios

I'm hosting a service in a Mac application and connecting with an iOS app. While the iOS app will find the service, the service doesn't contain any addresses, so I can't connect a socket.
This is my hosting code on the Mac:
- (void)start {
queue = dispatch_queue_create("KeyboardServer", DISPATCH_QUEUE_CONCURRENT);
socket = [[GCDAsyncSocket alloc] initWithDelegate:self delegateQueue:queue];
NSError *error = nil;
if ([socket acceptOnPort:0 error:&error]) {
service = [[NSNetService alloc] initWithDomain:#"local." type:#"_probonjore._tcp." name:#"TestServer" port:[socket localPort]];
service.delegate = self;
[service publish];
} else {
NSLog(#"Unable to create server");
}
}
This is the connecting code on iOS:
- (BOOL)connectToServer:(NSNetService *)service {
NSArray *addresses = service.addresses;
socket = [[GCDAsyncSocket alloc] initWithDelegate:self delegateQueue:queue];
for (NSData *address in addresses) {
NSError *error;
if ([socket connectToAddress:address error:&error]) {
NSLog(#"Socket connected!");
return true;
}
}
return false;
}
The problem is, service.addresses is always empty and the loop instantly exits.

For anyone curious, I searched around and found a solution.
In the
- (void)netServiceBrowser:(NSNetServiceBrowser *)browser didFindService:(NSNetService *)service moreComing:(BOOL)moreComing
function, you need to:
Add the service to an array to stop the object being deallocated as soon as it goes out of scope
Set the delegate on the object so that you can respond to its address resolution
Call the function to make it resolve
Which looks like this:
- (void)netServiceBrowser:(NSNetServiceBrowser *)browser didFindService:(NSNetService *)service moreComing:(BOOL)moreComing {
NSLog(#"Found Service %#", [service name]);
[services addObject:service];
[service setDelegate:self];
[service resolveWithTimeout:5.0f];
}
You then want to implement
- (void)netService:(NSNetService *)sender didNotResolve:(NSDictionary *)errorDict
and
- (void)netServiceDidResolveAddress:(NSNetService *)service
To catch when the address either resolves or doesn't resolve.

Related

Disconnecting with server immediately after connecting

I have written a Singleton Class using GCDAsyncsocket Library to establish connection with any other device having same service using Bonjour.
On one device I am using its Method "startPublishing" to make it a Host(Server), from the Application on another Device(Client) I am calling "StartBrowsing" to find out the available Devices in Network. When user selects any of service in that Network I am calling method "initConnectionWithService", that initiate Connection flow by resolving address of NetService to connect.
BonjourUtilClass.h
#interface BonjourUtilClass : NSObject<GCDAsyncSocketDelegate,NSNetServiceDelegate,NSNetServiceBrowserDelegate>{
NSNetService *netServiceToPublish;
GCDAsyncSocket *socketPub;
NSNetServiceBrowser *netServiceToBrowse;
GCDAsyncSocket *socketSub;
NSMutableArray *mutArrServices;
GCDAsyncSocket *socketConnected;
}
+(id)sharedInstance;
-(void)startPublishing;
-(void)startBrowsing;
-(void)initConnectionWithService:(NSNetService*)netServiceToConnect;
-(void)disconnectWithCurrent;
#end
BonjourUtilClass.m
static BonjourUtilClass *sharedObject = nil;
#implementation BonjourUtilClass
+(id)sharedInstance{
if(!sharedObject){
sharedObject = [[BonjourUtilClass alloc]init];
}
return sharedObject;
}
#pragma mark - Browsing
-(void)startBrowsing{
if(mutArrServices){
[mutArrServices removeAllObjects];
}else{
mutArrServices = [NSMutableArray array];
}
netServiceToBrowse = [[NSNetServiceBrowser alloc]init];
netServiceToBrowse.delegate= self;
[netServiceToBrowse searchForServicesOfType:#"_mrug._tcp" inDomain:#"local."];
}
-(void)stopBrowsing{
}
-(void)netServiceBrowser:(NSNetServiceBrowser *)aNetServiceBrowser didFindService:(NSNetService *)aNetService moreComing:(BOOL)moreComing{
[mutArrServices addObject:aNetService];
if(!moreComing) {
// Sort Services
[mutArrServices sortUsingDescriptors:#[[NSSortDescriptor sortDescriptorWithKey:#"name" ascending:YES]]];
// Update Table View
[[NSNotificationCenter defaultCenter]postNotificationName:kNotifyReloadList object:mutArrServices];
}
}
-(void)netServiceBrowser:(NSNetServiceBrowser *)aNetServiceBrowser didRemoveService:(NSNetService *)aNetService moreComing:(BOOL)moreComing{
[mutArrServices removeObject:aNetService];
if(!moreComing) {
// Sort Services
[mutArrServices sortUsingDescriptors:#[[NSSortDescriptor sortDescriptorWithKey:#"name" ascending:YES]]];
// Update Table View
[[NSNotificationCenter defaultCenter]postNotificationName:kNotifyReloadList object:mutArrServices];
}
}
-(void)netServiceBrowserDidStopSearch:(NSNetServiceBrowser *)aNetServiceBrowser{
NSLog(#"Search browser Did STOP search..");
[self stopBrowsing];
}
-(void)netServiceBrowser:(NSNetServiceBrowser *)aNetServiceBrowser didNotSearch:(NSDictionary *)errorDict{
NSLog(#"Search browser Did not search..");
[self stopBrowsing];
}
#pragma mark - NetService Delegate
-(void)startPublishing{
socketPub = [[GCDAsyncSocket alloc]initWithDelegate:self delegateQueue:dispatch_get_main_queue()];
NSError *aError;
if([socketPub acceptOnPort:0 error:&aError]){
netServiceToPublish = [[NSNetService alloc]initWithDomain:#"local." type:#"_mrug._tcp" name:#"" port:socketPub.localPort];
netServiceToPublish.delegate =self;
[netServiceToPublish publish];
}else{
NSLog(#"Unable To Create Socket..");
}
}
//NetService Delegates
-(void)netService:(NSNetService *)sender didNotPublish:(NSDictionary *)errorDict{
NSLog(#"Failed To Publish : Domain=%# type=%# name=%# info=%#",sender.domain,sender.type,sender.name,errorDict);
}
-(void)netServiceDidPublish:(NSNetService *)sender{
NSLog(#"Service Published : Domain=%# type=%# name=%# port=%li",sender.domain,sender.type,sender.name,(long)sender.port);
}
//Resolving Address
- (void)netService:(NSNetService *)service didNotResolve:(NSDictionary *)errorDict {
[service setDelegate:nil];
}
- (void)netServiceDidResolveAddress:(NSNetService *)service {
// Connect With Service
if ([self connectWithService:service]){
NSLog(#"Did Connect with Service: domain(%#) type(%#) name(%#) port(%i)", [service domain], [service type], [service name], (int)[service port]);
} else {
NSLog(#"Unable to Connect with Service: domain(%#) type(%#) name(%#) port(%i)", [service domain], [service type], [service name], (int)[service port]);
}
}
#pragma mark - GCDSocket delegates
-(void)socket:(GCDAsyncSocket *)sock didAcceptNewSocket:(GCDAsyncSocket *)newSocket{
NSLog(#"Accepted new Socket: HOST : %# , CONNECTION PORT :%li",newSocket.connectedHost,(long)newSocket.connectedPort);
}
-(void)socketDidDisconnect:(GCDAsyncSocket *)sock withError:(NSError *)err{
NSLog(#"Socket DisConnected %s,%#,%#",__PRETTY_FUNCTION__, sock,err);
if(socketPub == sock){
socketPub.delegate = nil;
socketPub = nil;
}else if (socketConnected == sock){
socketConnected.delegate=nil;
socketConnected = nil;
}
}
- (void)socket:(GCDAsyncSocket *)socket didConnectToHost:(NSString *)host port:(UInt16)port {
NSLog(#"Socket Did Connect to Host: %# Port: %hu", host, port);
// Start Reading
[socket readDataToLength:sizeof(uint64_t) withTimeout:-1.0 tag:0];
}
#pragma mark - Connection Methods
-(void)disconnectWithCurrent{
if(socketConnected){
[socketConnected disconnect];
socketConnected.delegate = nil;
socketConnected = nil;
}
}
-(void)initConnectionWithService:(NSNetService*)netServiceToConnect{
// Resolve Service
[netServiceToConnect setDelegate:self];
[netServiceToConnect resolveWithTimeout:30.0];
}
- (BOOL)connectWithService:(NSNetService *)service {
BOOL _isConnected = NO;
// Copy Service Addresses
NSArray *addresses = [[service addresses] mutableCopy];
if (!socketConnected || ![socketConnected isConnected]) {
// Initialize Socket
socketConnected = [[GCDAsyncSocket alloc] initWithDelegate:self delegateQueue:dispatch_get_main_queue()];
// Connect
while (!_isConnected && [addresses count]) {
NSData *address = [addresses objectAtIndex:0];
NSError *error = nil;
if ([socketConnected connectToAddress:address error:&error]) {
_isConnected = YES;
} else if (error) {
NSLog(#"Unable to connect to address. Error %# with user info %#.", error, [error userInfo]);
}
}
} else {
_isConnected = [socketConnected isConnected];
}
return _isConnected;
}
#end
But, On execution of above things very unexpected things happending, Device which is acting as Client is getting callback in didConnectedToHost and immediatly, another Callback is coming that is in didDisconnected
Logs on Client Device
2014-12-11 15:16:32.512 GCDSocketDemo[1419:71238] Did Connect with Service: domain(local.) type(_mrug._tcp.) name(ind506Bonjour) port(52026)
2014-12-11 15:16:32.659 GCDSocketDemo[1419:71238] Socket Did Connect to Host: 10.2.4.130 Port: 52026
2014-12-11 15:16:32.660 GCDSocketDemo[1419:71238] -[AppDelegate socketDidDisconnect:withError:],<GCDAsyncSocket: 0x7fa0a3533b90>,Error Domain=GCDAsyncSocketErrorDomain Code=7 "Socket closed by remote peer" UserInfo=0x7fa0a3532f70 {NSLocalizedDescription=Socket closed by remote peer}
Logs On Server Device
2014-12-11 15:15:48.546 GCDSockrtMacDemo[1397:70851] Service Published : Domain=local. type=_mrug._tcp. name=ind506Bonjour port=52026
2014-12-11 15:16:32.585 GCDSockrtMacDemo[1397:70851] Accepted new Socket: HOST : 10.2.4.130 , CONNECTION PORT :52029
2014-12-11 15:16:32.613 GCDSockrtMacDemo[1397:70851] -[BonjourUtilClass socketDidDisconnect:withError:],(null),(null)
Comment of Paulw11 Helped me to find out the Solution. Actually I stored Socket on client side, but forgot to Store reference of new Socket getting in callback method "didAcceptNewSocket".
So the Method didAcceptNewSocket should be as below:
-(void)socket:(GCDAsyncSocket *)sock didAcceptNewSocket:(GCDAsyncSocket *)newSocket{
NSLog(#"Accepted new Socket: HOST : %# , CONNECTION PORT :%li",newSocket.connectedHost,(long)newSocket.connectedPort);
socketConnected = newSocket;
}
So that newSocket received in this method can be persist for further communication. In earlier case it was releasing at end of method.

IOS SocketIO chat app issues, Node JS as backend

Friends
i am working on a chat application where there a function in backend like
client.on('mjmChatAddUser', function(user, room)
{
// Guest
if(user == null)
user = mjmChatCreateGuestName();
// Convert special characters to HTML entities
user = htmlEntities(user);
room = htmlEntities(room);
client.username = user;
client.room = room;
mjmChatUsernames.push(user);
client.join(room);
client.emit('mjmChatStatusUser', 'you have joined to '+ room +' room');
client.broadcast.to(room).emit('mjmChatStatusUser', user +' has joined to this room');
client.emit('mjmChatRooms', room);
io.sockets.to(room).emit('mjmChatUsers', mjmChatGetUsersRoom(room));
});
Now from ios side , I want to use ScoketIO to call this function , I have made connection to server but not enable to call this function , this what i am doing , is it right way , please guide me
- (void) viewDidLoad
{
[super viewDidLoad];
// create socket.io client instance
socketIO = [[SocketIO alloc] initWithDelegate:self];
// you can update the resource name of the handshake URL
// see https://github.com/pkyeck/socket.IO-objc/pull/80
// [socketIO setResourceName:#"whatever"];
// if you want to use https instead of http
// socketIO.useSecure = YES;
// pass cookie(s) to handshake endpoint (e.g. for auth)
NSDictionary *properties = [NSDictionary dictionaryWithObjectsAndKeys:
#"localhost", NSHTTPCookieDomain,
#"/", NSHTTPCookiePath,
#"auth", NSHTTPCookieName,
#"56cdea636acdf132", NSHTTPCookieValue,
nil];
NSHTTPCookie *cookie = [NSHTTPCookie cookieWithProperties:properties];
NSArray *cookies = [NSArray arrayWithObjects:cookie, nil];
socketIO.cookies = cookies;
// connect to the socket.io server that is running locally at port 3000
[socketIO connectToHost:#"MY SERVER" onPort:3000];
}
# pragma mark -
# pragma mark socket.IO-objc delegate methods
- (void) socketIODidConnect:(SocketIO *)socket
{
NSLog(#"socket.io connected.");
NSMutableDictionary *dict2 = [NSMutableDictionary dictionary];
[dict2 setObject:#"demo1" forKey:#"user"];
[dict2 setObject:#"php" forKey:#"room"];
[socketIO sendEvent:#"mjmChatAddUser" withData:#{#"Abc":#"php"}];
}
- (void) socketIO:(SocketIO *)socket didReceiveEvent:(SocketIOPacket *)packet
{
NSLog(#"didReceiveEvent()");
// test acknowledge
SocketIOCallback cb = ^(id argsData) {
NSDictionary *response = argsData;
// do something with response
NSLog(#"ack arrived: %#", response);
// test forced disconnect
[socketIO disconnectForced];
};
[socketIO sendMessage:#"hello back!" withAcknowledge:cb];
}
- (void) socketIO:(SocketIO *)socket onError:(NSError *)error
{
if ([error code] == SocketIOUnauthorized) {
NSLog(#"not authorized");
} else {
NSLog(#"onError() %#", error);
}
}
- (void) socketIODidDisconnect:(SocketIO *)socket disconnectedWithError:(NSError *)error
{
NSLog(#"socket.io disconnected. did error occur? %#", error);
}

GKLocalPlayer authentication not working, but isAuthenticated returns YES (Game Center sandbox)

I'm working on integrating turn based matches in my game and a few days ago I started getting weird errors from the GameKit API saying that the local player is not authenticated, even though he is.
When I launch the app, the authenticateHandler is called, the view controller is displayed and after entering the password, the authenticaHandler is called again and the local player seems to be authenticated. isAuthenticated returns YES.
But as soon as I start using any of the GameKit APIs like loadFriendsWithCompletionHandler:, an error is returned saying that the player has not been authenticated.
This is the code for handling authentication changes.
[[GKLocalPlayer localPlayer] setAuthenticateHandler:^(UIViewController *viewController, NSError *error) {
if ([[GKLocalPlayer localPlayer] isAuthenticated]) {
// Player authenticated
} else {
// Player not authenticated
if (viewController != nil) {
// Present view controller
}
}
}];
And this is the error message I receive when calling any of the GameKit methods. Please note that -isAuthenticated still returns YES when the error is returned.
Error finding match: Error Domain=GKErrorDomain Code=6 "The requested operation could not be completed because local player has not been authenticated." UserInfo=0x14e9f950 {NSLocalizedDescription=The requested operation could not be completed because local player has not been authenticated.}
(lldb) print (BOOL) [[GKLocalPlayer localPlayer] isAuthenticated]
(BOOL) $3 = YES
I'm testing in the Game Center sandbox and it started happening a few days ago. Previously, I didn't experience the problem at all.
It only happens about one of three times when the app is started. I have tried deleting the app, restarting my devices, cleaning the build folder and everything else I could think of.
Am I missing something or has anybody else experienced similar problems?
This rich Apple documentation is a great place to look at. Here are 2 things which I would suggest -
Game Center fails to complete authentication if your device has
incorrect dates. So, go ahead and check the current date.
You might have done this. I trust you - iOS Simulator >> Reset
Content and Settings
Do you think there could be something wrong with the way you are using -[GKLocalPlayer loadFriendsWithCompletionHandler:]? Nothing wrong with your authentication function above, but I'd love to share mine if it works for you -
-(void)authenticateLocalPlayer{
// Instantiate a GKLocalPlayer object to use for authenticating a player.
GKLocalPlayer *localPlayer = [GKLocalPlayer localPlayer];
localPlayer.authenticateHandler = ^(UIViewController *viewController, NSError *error){
if (viewController != nil) {
// If it's needed display the login view controller.
[self presentViewController:viewController animated:YES completion:nil];
}
else {
if ([GKLocalPlayer localPlayer].authenticated) {
// If the player is already authenticated then indicate that the Game Center features can be used.
_gameCenterEnabled = YES;
}
else {
_gameCenterEnabled = NO;
}
}
};
}
Why are you using Game Kit Framework?
From iOS 7 you should use MultipeerConnectivity.
1) – authenticateWithCompletionHandler: Deprecated in iOS 6.0.
And if you test on iOS 7 it may be doesn't work at all.
2) Below example for create connection via MultipeerConnectivity
Client:
- (id)init {
self = [super init];
if (self) {
NSString *peerName = [NSString stringWithFormat:#"%#-%#", #"Client", [[UIDevice currentDevice] identifierForVendor].UUIDString];
self.myPeerID = [[MCPeerID alloc] initWithDisplayName:peerName];
self.servers = [NSMutableArray array];
self.session = [[MCSession alloc] initWithPeer:self.myPeerID securityIdentity:nil encryptionPreference:MCEncryptionNone];
self.session.delegate = self;
self.browser = [[MCNearbyServiceBrowser alloc] initWithPeer:self.myPeerID serviceType:#"Connect"];
self.browser.delegate = self;
[self.browser startBrowsingForPeers];
}
return self;
}
//-----
- (void)browser:(MCNearbyServiceBrowser *)browser foundPeer:(MCPeerID *)peerID withDiscoveryInfo:(NSDictionary *)info {
NSLog(#"client: found a server: %#", peerID);
[self.browser invitePeer:peerID toSession:self.session withContext:nil timeout:10];
}
- (void)browser:(MCNearbyServiceBrowser *)browser lostPeer:(MCPeerID *)peerID {
NSLog(#"client: lost server: %#", peerID);
}
#pragma mark - MCSessionDelegate
- (void)session:(MCSession *)session peer:(MCPeerID *)peerID didChangeState:(MCSessionState)state {
NSLog(#"client: status changed to %d for server: %#", state, peerID.displayName);
switch (state) {
case MCSessionStateNotConnected: {
}
break;
case MCSessionStateConnected: {
}
break;
default:
break;
}
}
- (void)session:(MCSession *)session didReceiveData:(NSData *)data fromPeer:(MCPeerID *)peerID {
NSLog(#"client: received data (len = %lu) from server %#",(unsigned long)[data length], peerID.displayName);
NSDictionary *receiveDictionary = (NSDictionary*) [NSKeyedUnarchiver unarchiveObjectWithData:data];
}
Server:
- (id)init {
self = [super init];
if (self) {
NSString *peerName = [NSString stringWithFormat:#"%#-%#", #"Server", [[UIDevice currentDevice] identifierForVendor].UUIDString];
self.myPeerID = [[MCPeerID alloc] initWithDisplayName:peerName];
self.session = [[MCSession alloc] initWithPeer:self.myPeerID];
self.session.delegate = self;
self.advertiser = [[MCNearbyServiceAdvertiser alloc] initWithPeer:self.myPeerID
discoveryInfo:nil
serviceType:#"Connect"];
self.advertiser.delegate = self;
[self.advertiser startAdvertisingPeer];
}
return self;
}
#pragma mark - MCNearbyServiceAdvertiserDelegate
- (void)advertiser:(MCNearbyServiceAdvertiser *)advertiser didReceiveInvitationFromPeer:(MCPeerID *)peerID withContext:(NSData *)context invitationHandler:(void(^)(BOOL accept, MCSession *session))invitationHandler {
NSLog(#"server: did receive invitation from peer %#", peerID.displayName);
invitationHandler(YES, self.session);
}
- (void)advertiser:(MCNearbyServiceAdvertiser *)advertiser didNotStartAdvertisingPeer:(NSError *)error {
NSLog(#"server: error %#", error);
}
#pragma mark - MCSessionDelegate
- (void)session:(MCSession *)session peer:(MCPeerID *)peerID didChangeState:(MCSessionState)state {
NSLog(#"server: status changed to %ld for client: %#", state, peerID.displayName);
switch (state) {
case MCSessionStateConnected: {
NSMutableDictionary *sendDict = [NSMutableDictionary dictionary];
NSError *error = nil;
[self.session sendData:[NSKeyedArchiver archivedDataWithRootObject:sendDict]
toPeers:#[peerID]
withMode:MCSessionSendDataReliable
error:&error];
}
break;
case MCSessionStateNotConnected:
break;
default:
break;
}
NSLog(#"connectedPeers %#", self.session.connectedPeers);
}
- (void)session:(MCSession *)session didReceiveData:(NSData *)data fromPeer:(MCPeerID *)peerID {
NSLog(#"server: received data (len = %lu) from client %#", (unsigned long)[data length], peerID.displayName);
NSDictionary *dictionary = (NSDictionary*) [NSKeyedUnarchiver unarchiveObjectWithData:data];
}
- (void)session:(MCSession *)session didReceiveStream:(NSInputStream *)stream withName:(NSString *)streamName fromPeer:(MCPeerID *)peerID {
}
- (void)session:(MCSession *)session didStartReceivingResourceWithName:(NSString *)resourceName fromPeer:(MCPeerID *)peerID withProgress:(NSProgress *)progress {
}
- (void)session:(MCSession *)session didFinishReceivingResourceWithName:(NSString *)resourceName fromPeer:(MCPeerID *)peerID atURL:(NSURL *)localURL withError:(NSError *)error {
}
- (void)session:(MCSession*)session didReceiveCertificate:(NSArray*)certificate fromPeer:(MCPeerID*)peerID certificateHandler:(void (^)(BOOL accept))certificateHandler {
certificateHandler(YES);
}

GCDAsyncSockets, get answer

I'm trying to test a server connection with the GCDAsyncSocket.
https://github.com/robbiehanson/CocoaAsyncSocket
I want to connect to a ip + port and get a message, whether it worked, or not.
I'm so far right now.
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
// Override point for customization after application launch.
dispatch_queue_t mainQueue = dispatch_get_main_queue();
asyncSocket = [[GCDAsyncSocket alloc] initWithDelegate:self delegateQueue:mainQueue];
NSString *host = #"www.google.de";
uint16_t port = 21;
NSError *error = nil;
if(![asyncSocket connectToHost:host onPort:port error:&error])
{
NSLog(#"ERROR %#!!!", error);
}
else{
NSLog(#"NO ERROR %#!!!", error);
}
[asyncSocket writeData:#"DATA" withTimeout:3 tag:0];
return YES;
}
But how can i check whether the Data was written or not?
if(![asyncSocket connectToHost:host onPort:port error:&error])
always get me a no error.
You have to implement the socket:didWriteDataWithTag: delegate method.
From "GCDAsyncSocket.h":
/**
* Called when a socket has completed writing the requested data. Not called if there is an error.
**/
- (void)socket:(GCDAsyncSocket *)sock didWriteDataWithTag:(long)tag;
If the write times out then the connection is closed and the delegate method
- (void)socketDidDisconnect:(GCDAsyncSocket *)sock withError:(NSError *)err;
is called.

Xcode GCDAsyncSocket telnet connection

I'm having trouble getting started with GCDAsyncSocket to use a telnet connection.
When I connect through terminal I get some text and it asks me to login.
With GCDAsyncSocket I can get a connection but can't get any text from it.
- (void)viewDidLoad {
[super viewDidLoad];
NSLog(#"%s",__FUNCTION__);
socket = [[GCDAsyncSocket alloc] initWithDelegate:self delegateQueue:dispatch_get_main_queue()];
NSError *err = nil;
if (![socket connectToHost:#"192.168.1.1" onPort:23 error:&err])
{
// If there was an error, it's likely something like "already connected" or "no delegate set"
NSLog(#"I goofed: %#", err);
}
[socket readDataWithTimeout:5 tag:1];
}
.
- (void)socket:(GCDAsyncSocket *)sock didConnectToHost:(NSString *)host port:(uint16_t)port {
NSLog(#"Cool, I'm connected! That was easy.");
}
.
- (void)socket:(GCDAsyncSocket *)sock didReadData:(NSData *)data withTag:(long)tag {
NSLog(#"%s",__FUNCTION__);
NSString *responce = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];
NSLog(#"responce=%#",responce);
}
data responds with fffd01ff fd1ffffb 01fffb03
response is always null.

Resources