I need to help writing a VERY basic C program that will open a socket and send a message from one socket to a different socket. It doesn't need to be complex it just needs to work in windows and be very basic. I have no idea where to start as i have never programmed in C or with sockets before.
Also the Assignment is Due Tuesday
I'm Josie and I'm a moderator for this topic.
We have been working with our professionals to try to help you with your question. Sometimes it may take a bit of time to find the right fit.
I was checking to see if you had already found your answer or if you still need assistance from one of our professionals.
Please let me know if you wish to continue waiting or if you would like for us to close your question?
Also remember that JustAnswer has a multitude of categories to help you with all your needs from Pet to Legal.
I don't know what you mean?
It is an internet networking course and i am using an online compiler. it is compilr.com. If i need to i can download visual studio. The class is an introduction course to the networking infrastructure.
My instructor gave me very little direction so let me email him and see what I can get. I just know that I use a windows machine so... yea
Instructor: Write a TCP Socket app that has a client talking to a server and do the same thing for UDP. For both cases you should have two processes/programs on one computer talking to each other via the socket protocol.
Ok Ill definitely do that then.
my school gave out Visual studio 2012 how do i get this to run in 2012
i cant figure out how to change the start up files
Yes I was able to run the file the way you have sent it. I just need to figure out how to run the tcp. Also how easy is it to split the program into 2 so I dont have to do this?
Awesome thank you my class is at 3pm so before tjen would be great
Alright so part 2 is that i need to create A socket server that can do this list.
While running on my computer the socket server needs to:
Create a client that connects to other peoples servers with an address. So when i run the Client i need to be able to connect to there server by typing in an address and then connecting to it.
willing to pay 80$ for it to be finished by tomorrow night but if need be i would like to have it no later than Tuesday night for 60$
Yes a TCP Socket Server and no have them connect say welcome to jordans server and then ask them if they would like to download the .txt file with all of the peoples addresses that have connected to me. They need the .txt file to be able to connect to more people. is there any chance you could do this in C++ or is it easier in C. i know it would be easier for me to understand if it was in C++. Again it can be very basic. No need for any Extra's
So how does the client work there are sections of code i dont understand?
oh awesome thank you!
Here's an updated client cpp file.
If there are specific sections you don't understand, maybe write your questions directly in the file as comments and upload the file again.
After a long discussion with my instructor i have finally figured out what he is asking for. He wants me to create a server client program like you did, but instead of using an IP address he wants us to use host names. He said that i needed to look into get host name and set host name in the winsock library. He also said that when people connect to my server. I need to give them a Number so for example 8829421 then they need to be able to download my .txt file like we did that contains the host name of each person that connects to me. the other thing is that i need my client to be able to show my host name for which i am connecting from.
also i just tried to send you 40$ for the first portion of the program i was going to send you the rest when we finished please let me know if you have gotten it or not. it errored when i tried to submit it
i just got it to go through as a bonus so you should receive it soon. ill pay the other 40 when we finish. thanks for being patient and helping me out!
definitely take the rest of the week if you need to. he isnt strict on due date as long as i can show him im working on it.
On so the number is just a string it can be in the Welcome to my server your number is this. He did say it needed to be a 64 bit number not sure what that is but yea. Its mainly so that when i turn in the txt file he can reconcile with other students to make sure they actually connected to my server.
As for set host name im not sure if it something i need to use or if he was trying to give me an idea on where to look for information.
I do know however is that people need to connect to my machines host name which in sense will have my server running. Now im not sure how to find my exact host name(DNS i believe) i do know that when i was doing an ip config in CMD prompt it said something like mobile.asu.edu
one of my class mates sent an email out with this address. I am expecting TCP connections at adelorme.no-ip.biz port 5003
Hope that helps
The number is just a number that the client logging into my server is given so when my professor grades the lab, i say here is the number that they should have if they don't have this number they never connected to my server. And yea i guess the its more of a log book than an address book. but i like the way that you have it. and is the 64bit number a random number or a static?
does it pair the number with the address they connect with? or how will i give that info to my instructor?
how do i know my server hostname?
yes. i did a google search for my host name and tried to connect the client from the machine that i was running the server on to try and test it but i think i broke it lol. The client went haywire.
ok so this is were i get confused it says my hostname is JordanSmith-PC. Now how would someone use that address to connect to me. There could be a ton of people with JordanSmith-PC. How do people know that it is my computer? And yes i am on a college campus. I need to be able to connect to peoples clients through the internet.
Like I said this is where it gets tricky. Are all the other people on campus too?
Open a cmd prompt and type 'nslookup JordanSmith-PC'. What do you get?
You may need to get your instructor or campus IT guy involved because it depends entirely on how your network is configured, and there are a gazillion ways people do it.
Microsoft Windows [Version 6.2.9200](c) 2012 Microsoft Corporation. All rights reserved.C:\Users\Jordan Smith>nslookup JordanSmith-PC
Server: asudns3.asu.eduAddress: 18.104.22.168Aliases: 22.214.171.124.in-addr.arpaNon-authoritative answer:Name: JordanSmith-PC.mobile.asu.eduAddress: 10.140.112.248
Aha. So try and see if your client (or one of your friends', even better) can connect (from another computer) to the fully qualified name JordanSmith-PC.mobile.asu.edu at port 50000
My buddy was able to connect with just JordanSmith-PC on the same wifi when he gets home he is going to try and connect from his network. i gave him the client.exe so we will see....