![]() |
|
[C] Socket Programming - How to Connect to NetCat - Printable Version +- Hack Forums (https://hackforums.net) +-- Forum: Tech (https://hackforums.net/forumdisplay.php?fid=444) +--- Forum: Coding (https://hackforums.net/forumdisplay.php?fid=151) +---- Forum: Software Development (https://hackforums.net/forumdisplay.php?fid=118) +---- Thread: [C] Socket Programming - How to Connect to NetCat (/showthread.php?tid=6191084) |
Socket Programming - How to Connect to NetCat - LilDeepWeb - Jan 28, 2022 Hello HF, I'm currently learning Socket Programming in C. I was wondering why my Client program can connect to my Server program, but when I try to use NetCat to act as the listening server, the Client can't connect. Client.c Code #include <stdio.h>Server.c Code #include <stdio.h>When I try to connect my Client to NetCat it returns this: Code There was an error making a connection to the remote socket.I even decided to copy someone else's code on YouTube. Since he was doing it on Windows, I hopped onto my Windows machine and did the same thing he did. He even used NetCat as a listener. Unfortunately I'm still not able to connect to Netcat. I've been trying to find answers for this all day yesterday but with no luck. I was considering asking Stack Overflow, but lately I've been getting nothing but sarcastic remarks or no answers... Any help and explanation would be VERY much appreciated. Thank you for your time :) RE: Socket Programming - How to Connect to NetCat - yuumi - Jan 28, 2022 What's the netcat command you are issuing? RE: Socket Programming - How to Connect to NetCat - LilDeepWeb - Jan 28, 2022 (Jan 28, 2022 03:01 PM)yuumi Wrote: What's the netcat command you are issuing? The netcat command I'm using is: Code nc -l 9001I'm sorry, I should've probably specified that sooner... RE: Socket Programming - How to Connect to NetCat - yuumi - Jan 29, 2022 (Jan 28, 2022 03:05 PM)LilDeepWeb Wrote: The netcat command I'm using is:The reason is becauase your client is waiting for netcat to send a message while netcat is doing the same. This will work. Code int main() |