Search found 56 matches

by marco_84
Thu Apr 02, 2020 4:01 pm
Forum: C++ Development
Topic: problem with socket program for p2p
Replies: 42
Views: 945

Re: problem with socket program for p2p

Hello everybody I have inserted vectors with stl <vector>, in these days I have made attempts, now the program will not crash but the problem of multiple connection remains "if I connect a new IP it disconnects from the IP address already connected" place the responses of p2p socket connected betwee...
by marco_84
Sat Mar 28, 2020 1:13 am
Forum: C++ Development
Topic: problem with socket program for p2p
Replies: 42
Views: 945

Re: problem with socket program for p2p

Hi doublemax


the "pclient/sock" if I use them directly it disconnects the connection already established for to connect the new connection


marco_84
by marco_84
Fri Mar 27, 2020 12:10 pm
Forum: C++ Development
Topic: problem with socket program for p2p
Replies: 42
Views: 945

Re: problem with socket program for p2p

Hi Nunki it's just what I want to create, I did as you suggested, however, when I connect it crash giving me the following error: Thread 7 "p2psocket.run" received signal SIGSEGV, Segmentation fault. [Switching to Thread 0x7fffe99f8700 (LWP 1701)] 0x000000000043e60b in mysocket::connect (this=0xbccc...
by marco_84
Wed Mar 25, 2020 3:45 pm
Forum: C++ Development
Topic: problem with socket program for p2p
Replies: 42
Views: 945

Re: problem with socket program for p2p

Hi Nunki thanks for the suggestion, I have documented myself on peer to peer and I know how the client-server works. But I need a code with a basic example written with wxWidgets that makes me understand how I can connect to two nodes or more without not disconnecting any of the nodes already connec...
by marco_84
Wed Mar 25, 2020 10:13 am
Forum: C++ Development
Topic: problem with socket program for p2p
Replies: 42
Views: 945

Re: problem with socket program for p2p

Hi doublemax I badly explained myself... I need a basic code example on the mysocket :: connect function that can put new connections in a socket list without losing the other already active connections had this basic example I continue to implement the project I don't ask you all the code of the wh...
by marco_84
Tue Mar 24, 2020 11:00 pm
Forum: C++ Development
Topic: problem with socket program for p2p
Replies: 42
Views: 945

Re: problem with socket program for p2p

Hi doublemax I tried to make a socket list also for the client inside the function "mysocket :: connect", to make sure to insert the new open socket in a list, but I don't understand anything. Please could you write me the code? and then I try it this is the function, I was trying to edit: void myso...
by marco_84
Tue Mar 24, 2020 3:32 pm
Forum: C++ Development
Topic: problem with socket program for p2p
Replies: 42
Views: 945

Re: problem with socket program for p2p

Hi doublemax thank you!!! made me find the problem with the message was "sock" that I had not written correct "socket" now it correct connect and send messages well and now I have to do the p2p network, with my brother we found a gif image that explains my idea: https://forums.wxwidgets.org/download...
by marco_84
Tue Mar 24, 2020 12:20 am
Forum: C++ Development
Topic: problem with socket program for p2p
Replies: 42
Views: 945

Re: problem with socket program for p2p

Hi doublemax I need help to understand where to modify the program in this place how should I change it? void mysocket :: OnServerSocketEvent(wxSocketEvent& event) { wxSocketBase *sock = event.GetSocket(); // Now we process the event switch(event.GetSocketEvent()) { case wxSOCKET_INPUT: //if socket ...
by marco_84
Mon Mar 23, 2020 9:44 pm
Forum: C++ Development
Topic: problem with socket program for p2p
Replies: 42
Views: 945

Re: problem with socket program for p2p

Hi Kvaz1r p2p is a normal client/server program, the difference is only that client/server are inside the same executable file. Hi doublemax I added the codes you wrote to me, however the result is the usual... the messages return only to the sender for the number of clients that are connected to th...
by marco_84
Mon Mar 23, 2020 5:56 pm
Forum: C++ Development
Topic: problem with socket program for p2p
Replies: 42
Views: 945

Re: problem with socket program for p2p

Hi doublemax I have done research on the internet, but I haven't found anything that is right for me, I have made attempts including that of making the pSocket a pointer called clientsSocket as you can see in the lines of code below when I run the program and connect to the server it crash with the ...
by marco_84
Sun Mar 22, 2020 10:25 pm
Forum: C++ Development
Topic: problem with socket program for p2p
Replies: 42
Views: 945

Re: problem with socket program for p2p

Could you help me by giving me an example of a server that connects to multiple users simultaneously.
so i study to correct the gap of my project


thanks doublemax


marco_84
by marco_84
Sun Mar 22, 2020 4:36 pm
Forum: C++ Development
Topic: problem with socket program for p2p
Replies: 42
Views: 945

Re: problem with socket program for p2p

hello doublemax I tried to do as you suggested but when I have to use the IPaddress to send the message to all the other PCs, the message sent returns only to the PC that sends the message for the number of times as many clients are connected to the server. in this way: 3 connected PCs = 3 messages ...
by marco_84
Sat Mar 21, 2020 8:46 pm
Forum: C++ Development
Topic: problem with socket program for p2p
Replies: 42
Views: 945

Re: problem with socket program for p2p

hello doublemax in these command lines which post below, if I declare an array pointer of type "wxIPV4address" and call "GetPeer" inserting it in a position of the array does it work without problems? for example: wxIPV4address * addre; for (i = 0; i < total_ip; i++) { sock->GetPeer(addre ); logtext...
by marco_84
Sat Mar 21, 2020 6:27 pm
Forum: C++ Development
Topic: problem with socket program for p2p
Replies: 42
Views: 945

Re: problem with socket program for p2p

Hi doublemax I'll explain the question better: from the server program how can I view the IP addresses of the clients connected to that server at that moment? for example, through a "list" or similar command typed from the program prompt that I will build which displays the list of those who are con...
by marco_84
Sat Mar 21, 2020 3:33 pm
Forum: C++ Development
Topic: problem with socket program for p2p
Replies: 42
Views: 945

Re: problem with socket program for p2p

hi doublemax in essence the problem mentioned number 1 is this: is there a possibility to make a command or a C ++ code that stores the IP addresses of the clients connected to a server in a wxarraystring to be able to transmit chat messages by pointing the client's IP address to where the message i...