please provide easy study tutorials for beginners on socket creation for uploading data to web server via iphone app
You are confusing technologies in your question.
Bonjour is to broadcast and discover device over bluetooth or wifi.
If you want to simply upload data to your web server use ASIHTTPRequest. Note that this framework is no longer being developed and maintained. But will work for you.
Lets say I want to upload the contents of my NSString property called data:
NSString *data = @"This is the text I will send to my server";
I provide the url for the data to be uploaded to:
NSURL *url = [NSURL URLWithString:@"http://mysite.com/upload"];
I create a request that will handle the uplaod
ASIFormDataRequest *request = [ASIFormDataRequest requestWithURL:url];
I will upload my data using form request post value
[request addPostValue:data forKey:@"data"];
I will start the upload now and wait for it to finish (synchronous request)
[request startSynchronous];
NSError *error = [request error];
if (!error && [request responseStatusCode] == 200) {
//If all is ok this is the response from my server
[request responseString]];
}else{
//If something went wrong this is my error
NSLog(@"Error: \"%@\"",[[request error] localizedDescription]);
}