tagged [sockets]

What is AF_INET, and why do I need it?

What is AF_INET, and why do I need it? I'm getting started on socket programming, and I keep seeing this `AF_INET`. Yet, I've never seen anything else used in its place. My lecturers are not that help...

13 Jul at 07:24

Where can I find a list of SocketErrorCode and NativeErrorCode thrown by SocketException?

Where can I find a list of SocketErrorCode and NativeErrorCode thrown by SocketException? A SocketException has a SocketErrorCode and NativeErrorCode. I would like to find a list where these codes (or...

8 Dec at 22:12

IPC performance: Named Pipe vs Socket

IPC performance: Named Pipe vs Socket Everyone seems to say named pipes are faster than sockets IPC. How much faster are they? I would prefer to use sockets because they can do two-way communication a...

Bind failed: Address already in use

Bind failed: Address already in use I am attempting to bind a socket to a port below: ``` if( bind(socket_desc,(struct sockaddr *) &server, sizeof(server))

3 Jul at 15:42

Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)

Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) I am getting the following error when I try to connect to mysql: `Can't connect to local MySQL server through socket ...

12 May at 06:3

NetworkStream.Write vs. Socket.Send

NetworkStream.Write vs. Socket.Send I have a c# application that I use a custom FTP library for. Right now Im using Socket.Send to send the data but I was wondering if it would be better to initiate a...

2 Jul at 03:54

C# Using span with SocketAsyncEventArgs

C# Using span with SocketAsyncEventArgs I would like to use new Span to send unmanaged data straight to the socket using `SocketAsyncEventArgs` but it seems that `SocketAsyncEventArgs` can only accept...

6 Sep at 19:36

AcceptTcpClient vs AcceptSocket

AcceptTcpClient vs AcceptSocket I want to write a simple multi threaded server-client application and I've stumbled on those two while creating tcplistenr ``` public void serverListenr { int Messa...

25 May at 07:19

Detecting TCP Client Disconnect

Detecting TCP Client Disconnect Let's say I'm running a simple server and have `accept()`ed a connection from a client. What is the best way to tell when the client has disconnected? Normally, a clien...

28 Jul at 19:23

How can I get all the active TCP connections using .NET Framework (no unmanaged PE import!)?

How can I get all the active TCP connections using .NET Framework (no unmanaged PE import!)? How can I get all the the active TCP connections using .NET Framework (no unmanaged PE import!)? I'm gettin...

23 Feb at 09:49

Python [Errno 98] Address already in use

Python [Errno 98] Address already in use In my Python socket program, I sometimes need to interrupt it with . When I do this, it does close the connection using `socket.close()`. However, when I try t...

8 Dec at 06:10

Closing WebSocket correctly (HTML5, Javascript)

Closing WebSocket correctly (HTML5, Javascript) I am playing around with HTML5 WebSockets. I was wondering, how do I close the connection gracefully? Like, what happens if user refreshes the page, or ...

16 Nov at 08:0

Should I manually dispose the socket after closing it?

Should I manually dispose the socket after closing it? Should I still call `Dispose()` on my socket closing it? For example: I was wondering because [the MSDN documentation](http://msdn.microsoft.com/...

15 Feb at 20:25

how to create Socket connection in Android?

how to create Socket connection in Android? I have an application in which I need to create a socket connection. My requirement is: once my socket connection is established it needs to be alive until ...

6 Sep at 00:57

Programming P2P application

Programming P2P application I am writing a custom p2p program that runs on port 4900. In some cases when the person is behind a router, this port is not accessible from the internet. Is there an autom...

8 Jun at 11:26

Is it possible to convert between Socket and TcpClient objects?

Is it possible to convert between Socket and TcpClient objects? Here's another C#/.NET question based merely on curiousity more than an immediate ... If you had a `Socket` instance and you wanted to w...

14 Oct at 22:49

TCPClient vs Socket in C#

TCPClient vs Socket in C# I don't see much use of `TCPClient`, yet there is a lot of `Socket`? What is the major difference between them and when would you use each? I understand that .NET `Socket` is...

26 May at 14:51

Postman : socket hang up

Postman : socket hang up I just started using Postman. I had this error "Error: socket hang up" when I was executing a collection runner. I've read a few post regarding socket hang up and it mention a...

How to check if TcpClient Connection is closed?

How to check if TcpClient Connection is closed? I'm playing around with the TcpClient and I'm trying to figure out how to make the Connected property say false when a connection is dropped. I tried do...

7 Sep at 03:41

Getting the IP Address of a Remote Socket Endpoint

Getting the IP Address of a Remote Socket Endpoint How do I determine the remote IP Address of a connected socket? I have a RemoteEndPoint object I can access and well as its AddressFamily member. How...

15 Dec at 00:2

Communicating with a socket.io server via c#

Communicating with a socket.io server via c# Is there a c# client that follows the socket.io protocol? I have a socket.io server that is communicating with a socket.io javascript client via a website,...

27 Jun at 22:51

How do I remove a CLOSE_WAIT socket connection

How do I remove a CLOSE_WAIT socket connection I have written a small program that interacts with a server on a specific port. The program works fine, but: Once the program terminated unexpectedly, an...

6 Apr at 06:53

Can two applications listen to the same port?

Can two applications listen to the same port? Can two applications on the same machine bind to the same port and IP address? Taking it a step further, can one app listen to requests coming from a cert...

10 Nov at 20:34

Is there any functional difference in using Socket or UdpClient for multicasting?

Is there any functional difference in using Socket or UdpClient for multicasting? I am familiarizing myself with Multicasting and such. There are 2 primary examples used: 1. Using Socket with Bind() 2...

24 Dec at 01:52

Setting a timeout for socket operations

Setting a timeout for socket operations When I create a socket: It throws an exception, which is OK, because the IP address is not available. (The test variables where `String ipAddress = "192.168.0.3...

9 May at 07:45