Re: client/server communication using CFSocket (no one listening to port 2222)
Re: client/server communication using CFSocket (no one listening to port 2222)
- Subject: Re: client/server communication using CFSocket (no one listening to port 2222)
- From: "Rola Alame" <email@hidden>
- Date: Fri, 20 Jan 2006 07:39:04 +0000
From: Frederick Cheung <email@hidden>
To: Rola Alame <email@hidden>
CC: email@hidden
Subject: Re: client/server communication using CFSocket
Date: Thu, 19 Jan 2006 12:54:14 +0000
On 1/19/06, Rola Alame <email@hidden> wrote:
> Hello.
>
> I'm writing two applications: one is a client and the other is a server
for
> them to communicate over the network using TCP/IP. i'm using high level
> CFSocket function. The client is working fine. however, at the server,
i'm
> successfully creating the socket (with CFSocketCreate), but when i use
> "CFSocketSetAddress" to bind a port to that socket, it's returning
> kCFSocketError. and i can't figure out why. Here's the code for the
server:
>
> when irun this code i always get the error message printed on the
terminal.
> Can anyone tell me what the problem could be and how to solve it?
>
Just checking, 192.168.1.11 is an address of one of your machine's
interfaces (unless you have a particular need often it's best to bind
to INADDR), and there's no one else listening on port 2222 (use lsof
to check) ?
Fred
yes, this is the address of one of my machine interfaces. (i tried with
inaddr_any but it gave the same problem). also i'm sure that port 2222 is
free for two reasons:
1- i used lsof to be sure, and
2- i ran another server program that i wrote using BSD socket functions
(socket, accept, listen, bind...) and the CFSocket client and BSD socket
server were able to communicate together.
What do you figure?
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Macnetworkprog mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden