Im trying to translate a php script to work natively with our cocoa application.
I am using CocoaAsyncSocket to handle UDP connections.
In php its done..
And I am doing..
Logged is..
Which is as expected, but nothing happens on the server and no response is given.
Cheers.
I am using CocoaAsyncSocket to handle UDP connections.
In php its done..
Code:
$fp = fsockopen("udp://".$set['IP'],$set['Port'], $errno, $errstr, 2);
socket_set_timeout($fp,2);
$query = "\xFF\xFFcmd $authtok $goget";
fwrite($fp,$query);
$d = fread ($fp, 10000);
Code:
socket = [[GCDAsyncUdpSocket alloc] initWithDelegate:self delegateQueue:dispatch_get_main_queue()];
NSString *msg = [NSString stringWithFormat:@"%c%ccmd %@ %@", 0xFF, 0xFF, authtok, goget];
NSData *data = [msg dataUsingEncoding:NSUTF8StringEncoding];
[socket sendData:data toHost:@"85.25.248.160" port:28960 withTimeout:-1 tag:tag];
NSLog(@"%@", FORMAT(@"SENT (%i): %@", (int)tag, msg));
Code:
ˇˇcmd <authtok> <goget>
Cheers.