Home > Software engineering >  Socket programming problem
Socket programming problem

Time:10-04

Actual scenario goes like this:
1, using the TCP protocol;
2, there are two sets of equipment, I need to write computer software and two devices communication access equipment current status;
3, both machine as the server side;

In communication under the condition of no problem, with a single device used in multiple devices under has a device has been sending data, the other data are hard to come over, I defined two sockets, respectively with two devices communicate, adopting CAsyncSocket way at present, with the server side when binding to a 10048 error, beg god to help solve!

CodePudding user response:

1. PC open multithreading communication
2.10048 error online port occupy,

CodePudding user response:

Any speed of sending and receiving ends inconsistent communication, need to use a large enough between them the FIFO buffer,
The use of any FIFO buffer, are all need to carefully consider the receiver to receive countless overtime according to and the sender sends the FIFO buffer is full in both cases what to do,

CodePudding user response:

Using multiple process?

CodePudding user response:

Skip the binding of a service?

CodePudding user response:

You two devices as a server, open ports are the same?

CodePudding user response:

You two threads on the client, a thread corresponding to a server communication,

CodePudding user response:

The client generally do not need to bind port, initialize the socket - & gt; Establish a network connection - & gt; To send and receive data - & gt; disconnect

CodePudding user response:

The
quoted zhao teacher reply: 3/f
using multiple process?
I use multiple processes, or not

CodePudding user response:

quoted zhao 4, 4/f, the teacher's reply:
skip binding of a service?
would it be the reason for my client binding:
  • Related