-
April 13th, 2004, 12:14 PM
#1
TCP/IP Application
Can anyone help me, I'm having a little trouble connecting to a host. The host in this case is a micro-controller, and it has an IP address which I know, and I want to connect to it. I've tried WinSock, but I haven't had any success with it. The micro-controller has an IP address, but no port number. I need to be able to send commands and receive a response from the micro-controller. But first, I just want to connect to it via TCP/IP. Any information you can give me would be really appreciated. Thanks.
-
April 13th, 2004, 12:20 PM
#2
Hm.. is there a winsock server running on the host ? If not, I don't see any reason why a connect will ever be successful from the client.
-
April 13th, 2004, 01:38 PM
#3
It's funny you should mention that because it never crossed my mind. I've been looking into winsock for the past two days. To answer your question, no, there is no winsock server running on the micro-controller. The problem I'm having is that I haven't dealt with TCP/IP yet, so I'm not even sure where to start. I've done a search on the forum, but haven't found anything helpful so if anyone can point me in the right direction, I would really appreciate it. Thanks again.
-
April 13th, 2004, 01:43 PM
#4
Sounds like the microcontroller is "socketless". You need to find out what protocols it actually expects...time to RTFM...
TheCPUWizard is a registered trademark, all rights reserved. (If this post was helpful, please RATE it!)
2008, 2009,2010
In theory, there is no difference between theory and practice; in practice there is.
* Join the fight, refuse to respond to posts that contain code outside of [code] ... [/code] tags. See here for instructions
* How NOT to post a question here
* Of course you read this carefully before you posted
* Need homework help? Read this first
-
April 13th, 2004, 01:46 PM
#5
-
April 13th, 2004, 02:04 PM
#6
Manufacturere told me the micro-controller uses TCP/IP protocol. So is there no way I can connect to the micro-controller if I know the IP address only?
-
April 13th, 2004, 02:22 PM
#7
Originally posted by kodeguruguy
So is there no way I can connect to the micro-controller if I know the IP address only?
Well...you should know the port number as well...
-
April 13th, 2004, 05:14 PM
#8
So true. The whole point about TCP/IP (I think it's written in the protocol spec but I may be wrong) that it comes with an IP address AND a port number.
You must know the port number to be able to communicate.
Darwen.
-
April 15th, 2004, 01:34 AM
#9
run a server is necessary if you use the socket to communicate i think .
and normally, the server is binded to its ip & port, and waiting to recv connection to it.
wxuf
Waiting OFFERS from CMU, UMass, UC Davis, OSU
Mail to me
-
April 16th, 2004, 10:53 AM
#10
First off, I want to say thanks to everyone for their response. I just got off the phone with the manufacturer and got the port number for this micro-controller. So now I got the IP address and the port number, so I should be able to communicate with it with Winsock right? Anyone know where I can find a simple code for reference, or any tutorials? I've never worked with Winsock before.
-
April 16th, 2004, 12:46 PM
#11
Hello:
I was in the same trouble about starting programming winsock, i can give you those links, they are very clear in connecting and accepting connections...in your case you only have to create a socket with the ip and port and if the server accept you, you can start sending and receiving data ...
Here are the links:
http://tangentsoft.net/wskfaq/exampl...ed-server.html
http://www.codeproject.com/internet/winsockintro01.asp
Well, one more thing: if you want to use MFC you can check the doucmentacion for the CAsyncSocket and CSocket classes, they encapsulate winsock at a higher level....
Greetings
-
April 16th, 2004, 12:59 PM
#12
Originally posted by kodeguruguy
Anyone know where I can find a simple code for reference, or any tutorials? I've never worked with Winsock before.
Winsock Programmer's FAQ...
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
|
Click Here to Expand Forum to Full Width
|