943,769 Members | Top Members by Rank

Ad:
  • C Discussion Thread
  • Unsolved
  • Views: 14139
  • C RSS
Jul 9th, 2007
0

How to Send Data to IP address

Expand Post »
Hi all,

For my project I have to send data from dos computer to a IP address ( i.e 216.152.xx.xxx port 57.
I have no idea how to accomplish this task. PC is connected to internet. I can do this using microsoft windows. But i dont know how to do it using DOS (non windows enviornment)
Also I am using turbo C.

Any idea??
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
gemni7 is offline Offline
5 posts
since Jul 2007
Jul 9th, 2007
0

Re: How to Send Data to IP address

You need to learn little bit of socket programming , check any network book (e.g. stevens )
Reputation Points: 769
Solved Threads: 128
Banned
ithelp is offline Offline
1,910 posts
since May 2006
Jul 9th, 2007
0

Re: How to Send Data to IP address

DOS network programming is not directly supported by TURBO C. If someone assigned this task to you then that person must have some linkable files to supply TCP/IP support.
This stuff is VERY old. TURBO C should be banned from classrooms. IMO.

There were some network support libraries here:
http://alumnus.caltech.edu/~dank/trumpet/
Reputation Points: 62
Solved Threads: 10
Junior Poster
jim mcnamara is offline Offline
179 posts
since May 2004
Jul 16th, 2007
0

Re: How to Send Data to IP address

The above links will help you learn about sockets.

What you're looking to do is..

Create a socket (using socket() ).
Setup destination for this socket, and the port you want to make this socket connect to (check the links).

Try connecting to another socket at the destination end (using connect() ).

Send information to this socket (using send() )


The above is based on TCP/IP, so you can create a TCP/IP 3-way handshake, and verify that data has been transferred correctly.
Using UDP would just send the data and we wouldnt know if it has been received or not.


Any questions or elaboration needed.
Just reply.
Cheers.
Last edited by dr4g; Jul 16th, 2007 at 5:05 am.
Reputation Points: 35
Solved Threads: 5
Junior Poster
dr4g is offline Offline
136 posts
since Apr 2007

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in C Forum Timeline: abt priject
Next Thread in C Forum Timeline: variable arguments in C





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC