Skip to main content
AI Assist is now on Stack Overflow. Start a chat to get instant answers from across the network. Sign up to save and share your chats.
added 422 characters in body
Source Link

I want to establish tcp connection between iphone and PC. On PC QTspServer is running and working (was tested with other client application).

Here is the connection method i'm using on iphone:

- (IBAction)connectToServer:(id)sender { CFReadStreamRef read = NULL; CFWriteStreamRef write = NULL; NSString *host = @"192.168.1.169"; CFStreamCreatePairWithSocketToHost(kCFAllocatorDefault, (CFStringRef)host, 1000, &read, &write); CFWriteStreamOpen(write); int k = 0; } 

The server on PC is not reacting. Any help is appropriate

By the way: Server is nothing more then a QTcpServer with replemented incomingConnection method. Here is the main function on server side:

int main(int argc, char **argv) { QApplication app(argc, argv); AbstractServer server; server.listen(QHostAddress::Any, 1000); QLabel label("Hello server"); label.setFixedSize(400, 400); label.show(); return app.exec(); } 

I want to establish tcp connection between iphone and PC. On PC QTspServer is running and working (was tested with other client application).

Here is the connection method i'm using on iphone:

- (IBAction)connectToServer:(id)sender { CFReadStreamRef read = NULL; CFWriteStreamRef write = NULL; NSString *host = @"192.168.1.169"; CFStreamCreatePairWithSocketToHost(kCFAllocatorDefault, (CFStringRef)host, 1000, &read, &write); CFWriteStreamOpen(write); int k = 0; } 

The server on PC is not reacting. Any help is appropriate

I want to establish tcp connection between iphone and PC. On PC QTspServer is running and working (was tested with other client application).

Here is the connection method i'm using on iphone:

- (IBAction)connectToServer:(id)sender { CFReadStreamRef read = NULL; CFWriteStreamRef write = NULL; NSString *host = @"192.168.1.169"; CFStreamCreatePairWithSocketToHost(kCFAllocatorDefault, (CFStringRef)host, 1000, &read, &write); CFWriteStreamOpen(write); int k = 0; } 

The server on PC is not reacting. Any help is appropriate

By the way: Server is nothing more then a QTcpServer with replemented incomingConnection method. Here is the main function on server side:

int main(int argc, char **argv) { QApplication app(argc, argv); AbstractServer server; server.listen(QHostAddress::Any, 1000); QLabel label("Hello server"); label.setFixedSize(400, 400); label.show(); return app.exec(); } 
tags
Link
chrisaycock
  • 38.1k
  • 15
  • 94
  • 128
Source Link

iphone tcp connection

I want to establish tcp connection between iphone and PC. On PC QTspServer is running and working (was tested with other client application).

Here is the connection method i'm using on iphone:

- (IBAction)connectToServer:(id)sender { CFReadStreamRef read = NULL; CFWriteStreamRef write = NULL; NSString *host = @"192.168.1.169"; CFStreamCreatePairWithSocketToHost(kCFAllocatorDefault, (CFStringRef)host, 1000, &read, &write); CFWriteStreamOpen(write); int k = 0; } 

The server on PC is not reacting. Any help is appropriate