Search
 
SCRIPT & CODE EXAMPLE
 

CPP

c++ bind port

s = socket(AF_INET, SOCK_STREAM, 0);
/* ... */

memset(&client_addr, 0, sizeof(client_addr));
client_addr.sin_family = AF_INET;
client_addr.sin_port = htons(22222);

if (bind(s, (struct sockaddr *) &client_addr, sizeof(client_addr)) < 0) {
    perror("bind");
    exit(1);
}

connect(s, (struct sockaddr *) &server_addr, sizeof(server_addr));
Comment

PREVIOUS NEXT
Code Example
Cpp :: vector and algorithm 
Cpp :: Summation of Natural Number Sequence with c and c++. 
Cpp :: can i delete a null pointer in c++ 
Cpp :: switch cout print with a prameter c++ 
Cpp :: . Shell sort in c++ 
Cpp :: How To Calculate 1+1 in c++ 
Cpp :: static member fn , instance 
Cpp :: pointers mcq sanfoundry 
Cpp :: how to measure cpp code performace 
Cpp :: how to change the icon of an exe in c++ 
Cpp :: c++ conditional typedef 
Cpp :: zsh: segmentation fault ./provided_files.exe erosion X . 
Cpp :: comentar todas linhas de uma vez vs code 
Cpp :: find node from pos linkedlist c++ 
Cpp :: how to i convert C++ into C 
Cpp :: comment installer boost c++ sur windows 
Cpp :: distinct numbers cses 
Cpp :: c++ single comment 
Cpp :: flowchart to display factors of a number 
Cpp :: set keybinding for compiling c++ program in neovim 
Cpp :: create a table using pointers in C++ 
Cpp :: Extended Euclid Algorithm Recursive Solution 
Cpp :: Make them equal codechef solution in c++ 
Cpp :: Use command line arguments to create file c++ 
Cpp :: deal with bad input cpp 
Cpp :: convert "c++ to c" code online 
Cpp :: comment savoir si un nombre est premier c++ 
Cpp :: can derived class access base class non-static members without object of the base class 
Cpp :: how to display score using SDL in c++ 
Cpp :: qt widget list set selected 
ADD CONTENT
Topic
Content
Source link
Name
3+3 =