Questions tagged [berkeley-sockets]

The Berkeley sockets API comprises a library for developing applications in the C programming language that perform inter-process communication, most commonly for communications across a computer network.

In computer networking, a socket is an endpoint of a bidirectional inter-process communication flow across an Internet Protocol-based computer network, such as the Internet.

A socket address is the combination of an IP address (the location of the computer) and a port (which is mapped to the application program process) into a single identity, much like one end of a telephone connection is the combination of a phone number and a particular extension.

The term is believed to have originated with the Berkeley Sockets API for Unix ca. 1983.

67 questions
0
votes
1 answer

Receiving data from socket using recv not working

I'm trying to create a simple proxy server using BSD sockets, which listens on a port for a request and then passes that request on to another server, before sending the server's response back to the browser. I am able to receive a REST request from…
Jack Greenhill
  • 10,240
  • 12
  • 38
  • 70
0
votes
1 answer

Berkeley Socket Send returning 0 on successful non-blocking send

I am writing a non-blocking chat server, so far the server works fine, but I can't figure out how to correct for partial sends if they happen. The send(int, char*, int); function always returns 0 on a success and -1 on a failed send. Every doc/man…
0
votes
1 answer

Berkeley socket communication, send and receive structs

I have a assignment where I am going to implement a score-server for a game. When a game is done the game is going to send() players name (char *name) and score (int score) to the server for registration, receive(), and the server is going to send…
user265767
  • 559
  • 3
  • 12
  • 27
0
votes
1 answer

Berkeley sockets: connect() returns -1 with errno set to ENOENT

I have this code: bool CBSocketConnect(uint64_t socketID,uint8_t * IP,bool IPv6,uint16_t port){ // Create sockaddr_in6 information for a IPv6 address int res; if (IPv6) { struct sockaddr_in6 address; memset(&address, 0,…
Matthew Mitchell
  • 5,293
  • 14
  • 70
  • 122
0
votes
0 answers

Portable IPv6 connections with BSD/POSIX sockets

I need to connect to an IPv6 address. This is not hardcoded. I will obtain IPv6 addresses in byte form (char *) and they will not be retrieved using DNS (No luck with getaddrinfo). The problem is, the sockaddr_in6 structure that I'm supposed to fill…
Matthew Mitchell
  • 5,293
  • 14
  • 70
  • 122
-1
votes
1 answer

Aborted (core dumped) removing element from vector in c++

I'm trying to learn C++ using "MUD Game Programming" and I am working through the examples, but when I try to erase a connection from a vector I get an error: "Aborted (core dumped)." This usually happens when erasing the last one from the vector. I…
noworld
  • 3
  • 1
-1
votes
2 answers

How to make a .cpp file to act as an accessible server

I have written a simple program with Linux (Cent OS 7.0) and C++. It is a very small server which sends back a string of characters to the client. But my problem is that I don't know how should I access that server using an IP address? I have used…
Mostafa Talebi
  • 8,825
  • 16
  • 61
  • 105
1 2 3 4
5