 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Ori Guest
|
Posted: Mon Aug 28, 2006 12:59 pm Post subject: Ethernet -- -- -- -- > How to start ? |
|
|
Hi all, I need to write a simple application that send a message
through Ethernet and get response, I have no idea how to start
this, I only know how to communicate using Rs-232, my computer
is connected to a local network, can I use this connection for
my Ethernet tests? what should I install? where can I find a
clear example that shows me how to init the Ethernet, how to send
and how to recieve?
I got some good links from Bob Gonder (Thanks!) and they includ
a source codes for the server -
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winsock/winsock/complete_server_code.asp
and for the client -
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winsock/winsock/complete_client_code.asp
but I don't know how to make them work, I copied them to a new
builder project (Builder 4.0, on Windows-2000 PC) and I get lot
of errors, for example it don't know 'AI_PASSIVE', and it can't
find the getaddrinfo() function, and lot of other errors, how do
I make this code working?
I want to run the server code on one computer and the client code
on another computer and to see them talking with each other
through the local network, can you please help me to complete
this?
Thanks,
Ori. |
|
| Back to top |
|
 |
Ori Guest
|
Posted: Mon Aug 28, 2006 1:00 pm Post subject: Re: |
|
|
|
|
| Back to top |
|
 |
Bob Gonder Guest
|
Posted: Tue Aug 29, 2006 8:10 am Post subject: Re: Ethernet -- -- -- -- > How to start ? |
|
|
Ori wrote:
| Quote: | of errors, for example it don't know 'AI_PASSIVE', and it can't
find the getaddrinfo() function, and lot of other errors, how do
I make this code working?
|
AI_PASSIVE:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winsock/winsock/addrinfo_2.asp
Which lists the Flags for addrinfo, including 'AI_PASSIVE', which I
found by typing AI_PASSIVE in the search box which is in the upper
left of every page........
But..... It looks like getaddrinfo is a new function, and you don't
really need it. It is used to get the values for this call...
| Quote: | ListenSocket = socket(result->ai_family, result->ai_socktype, result->ai_protocol);
|
But the old way works too, and is easier...
ListenSocket = socket( AF_INET, SOCK_STREAM, IPPROTO_TCP );
You should only need
#include <winsock2.h>
#include <windows.h>
Also, I suggest you get send/receive working on a single CPU before
venturing into the realm of PC-to-PC. |
|
| Back to top |
|
 |
Michel Leunen Guest
|
Posted: Tue Aug 29, 2006 8:13 pm Post subject: Re: Ethernet -- -- -- -- > How to start ? |
|
|
Ori wrote:
| Quote: | I got some good links from Bob Gonder
|
Another good one with sources:
http://www.tangentsoft.net/wskfaq/
Michel
--
----------------------------------------
Michel Leunen
mailto: see my homepage.
C++Builder, BCC5.5.1 Web site:
http://www.leunen.com/
---------------------------------------- |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|