Похожие чаты

Hi, for my case right it is possible for my

computer to be client and server.
So Is it alright for me to not include the server? As for the async socket method, creating of server and client is needed. So i am not sure about the method of having only both client without a server.

1 ответов

5 просмотров

Is just understanding the pattern and the implementation. When creating a server socket to handle connections, you save every other sockets that connects to your server. In your case it is just one. That saved socket is the one you are going to use to communicate from A to B and vice versa. So normally A is the server. When B starts he tries to connect to A. A accepts connection and saves socket info. Now every time A wants to say something to B he uses that saved socket. And when B receives info, he receives it on that socket he created and which is the one saved by A. B responds to A via that same socket. And the process continues...

Похожие вопросы

Обсуждают сегодня

Hey people, how do I unstake from the old pool and stake in the new pool??
Dyldo Baggins
24
А чем вам питонисты не угодили?😂
.
79
Есть какой-нибудь для Delphi/FPC T*Compression(Decompression)Stream на базе LZ4/Zstd/любой другой быстрый(и хорошо сжимающий) алгоритм А ещё лучше в pure pascal А ещё лучше од...
notme
32
Hey guys, did you see the new announcement about $Fun? 🔥
Filip Murphy
55
Hello. Could you please help me with finding all coordinates within a radius using a spatial index, given that I have a table with coordinates? SET @lng = 37.57925; SET @lat ...
Rinchin G
7
Язык Си можно выучить за день? По книжке ANSI C на 230 страниц
Vincent Vegan
29
Не получается у меня либу Zstd статически слинковать, вылазят какие-то AV Вроде example у них не сложный есть, вроде всё делаю как там... но не выходит чего-то Вопрос - если ...
notme
4
Всем привет, написал код ниже, но он выдает сегфолт, в чем причина? #include <stdio.h> #include <stdlib.h> #include <string.h> struct product { char *name; float price; };...
buzz базз
75
Привет, запускаю werf в dind в k8s, получаю ошибку на этапе build/beforeSetup: /.werf/stapel/embedded/bin/bash: /.werf/scripts/5898bdfe5214357d3706b879cc8d3d78460fb379607cbd...
florius0
7
Всех приветствую. Направьте меня в нужное русло. Постепенно переписываю проект с delphi на lazarus. Приложение - обычный windows/linux клиент для бд firebird. Тут все хорошо. ...
Mishutka
8
Карта сайта