BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Ethernet -- -- -- -- > How to start ?

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (Internet Socket)
View previous topic :: View next topic  
Author Message
Ori
Guest





PostPosted: Mon Aug 28, 2006 12:59 pm    Post subject: Ethernet -- -- -- -- > How to start ? Reply with quote



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





PostPosted: Mon Aug 28, 2006 1:00 pm    Post subject: Re: Reply with quote



Back to top
Bob Gonder
Guest





PostPosted: Tue Aug 29, 2006 8:10 am    Post subject: Re: Ethernet -- -- -- -- > How to start ? Reply with quote



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





PostPosted: Tue Aug 29, 2006 8:13 pm    Post subject: Re: Ethernet -- -- -- -- > How to start ? Reply with quote

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
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (Internet Socket) All times are GMT
Page 1 of 1

 
Jump to:  
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


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.