-
September 10th, 2004, 02:57 AM
#1
Junior Member
opening a port?
Does anybody know how I can open a port in a C++ command line program?If so please help me I am in diar need!
-
September 10th, 2004, 03:00 AM
#2
It depends what port (although in command line applications, I'm sure your limited). Can I ask why you need it so bad, as you say you are in "diar need"?
-
September 10th, 2004, 03:04 AM
#3
You need to create sockets and have data accepted through it and a wide variety of things... I've never done it in C++ but have in Java... you need the socket.h header from what I found (http://www.adp-gmbh.ch/win/misc/sockets.html).
[edit]
Typo.
-
September 10th, 2004, 03:11 AM
#4
Junior Member
My friends and I are trying to write this program in which we open each others ip addresses to view programs so we can share files. We felt like a challange. I promised I would write the part to where it will open the port in which we would use. I don't want to disappoint them, because I promised.
-
September 10th, 2004, 03:54 AM
#5
I would say your best bet is to find some sample code and work from that. I don't know about C++, but in C sockets seem to be sort of complicated. I want to try and learn them so I'm going to do what I just suggested you do. Getting bits of code and messing with them. If you mess with them long enough the info just sticks and you can pretty much write the code from scratch. Good luck. Peace.
-
September 10th, 2004, 10:12 AM
#6
The good thing about C++ would be that you could write up your own class (assuming one didn't already exist) to encapsulate all the annoying socket code so that you didn't have to remember it all.
ac
-
September 10th, 2004, 04:04 PM
#7
Originally posted here by gothic_type
The good thing about C++ would be that you could write up your own class (assuming one didn't already exist) to encapsulate all the annoying socket code so that you didn't have to remember it all.
ac
Make a tut on it . Can you do the same thing with C? There is no doubt with java, but I'm starting C and I want to do some leet codez.
-
September 10th, 2004, 04:11 PM
#8
ZC anything you can do in C++ you pretty much can do with C. I have some code around somewhere on programming sockets in C and C++.
Of Course I am going to have to give my normal statement. PRogramming sockets in perl, isn't that hard.
-
September 10th, 2004, 04:27 PM
#9
It's easy in java. I want to learn in C though :P. I've been skimming a .chm on unix socket programming in C, and it seems kind of complicated. I was actually skimming it before my history quiz instead of my history stuff. That might have been a mistake. Looks like it might take me a while to get the concept down. Maybe if I read the chm instead of skimming it something will stick. Or maybe I just need a better reference . The book for my class mentions having some code for a simple UNIX shell. I want to take a look at that. Sounds interesting. Peace and perl sucks (j/k).
-
September 10th, 2004, 05:28 PM
#10
ZC, don't make me slap you. I will put the C scripts that I Have in my home directory and name then C-****. Take a look at them whenever you get a chance. I looked in the book, I got them from, and they are for a Connection server and client.
Perl pwns Java any day.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|