Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6654107
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T01:21:02+00:00 2026-05-26T01:21:02+00:00

#import <sys/socket.h> #import <netinet/in.h> #import <arpa/inet.h> I have import the headers above,but setsockopt(CFSocketGetNative(TCPSocket), SOL_SOCKET,

  • 0
#import <sys/socket.h>
#import <netinet/in.h>
#import <arpa/inet.h>

I have import the headers above,but

setsockopt(CFSocketGetNative(TCPSocket), SOL_SOCKET, SO_REUSEADDR, (void *)&yes, sizeof(yes));

show warnings “use of undeclared identifier ‘TCPSocket'”;do I need to import other header files?

add:

CFSocketContext CTX = {0,self,NULL,NULL,NULL};
    _socket = CFSocketCreate(kCFAllocatorDefault, PF_INET, SOCK_STREAM, IPPROTO_TCP, kCFSocketConnectCallBack, TCPServerConnectCallBack, &CTX);
    setsockopt(CFSocketGetNative(_socket), SOL_SOCKET, SO_REUSEADDR, (void *)&yes, sizeof(yes));

I have insteaded TCPSocket of _socket.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T01:21:02+00:00Added an answer on May 26, 2026 at 1:21 am

    What is TCPSocket here? It is supposed to a variable of type CFSocketRef. It looks like you need to set that up first. Post more code and maybe we can be of more help.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

import sys sys.path.append('/home/myuser/svn-repos/myproject') from myproject.settings import * But, it says module not found when
i have the following script import getopt, sys opts, args = getopt.getopt(sys.argv[1:], h:s) for
I have following code import sys from ctypes import * from ctypes.util import find_library
from Tkinter import * import socket, sys, os import tkMessageBox root = Tk() root.title(File
from Tkinter import * import socket, sys from PIL import Image, ImageTk root =
here is my code : import socket import sys import re import base64 import
import sys words = { 1 : 'one', 2 : 'two', 3 : 'three',
Consider this python program: import sys lc = 0 for line in open(sys.argv[1]): lc
The python implementation import sys def move(src, dst, tmp, num): if num == 1:
The only nice way I've found is: import sys import os try: os.kill(int(sys.argv[1]), 0)

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.