🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: borland.public.cppbuilder.internet.socket
4 messages
4 total messages Started by Ori Mon, 28 Aug 2006 07:59
Ethernet -- -- -- -- > How to start ?
#2044
Author: Ori
Date: Mon, 28 Aug 2006 07:59
31 lines
2062 bytes
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.
Re:
#2043
Author: Ori
Date: Mon, 28 Aug 2006 08:00
3 lines
740 bytes

   
Re: Ethernet -- -- -- -- > How to start ?
#2045
Author: Bob Gonder
Date: Tue, 29 Aug 2006 03:18
25 lines
1964 bytes
Ori wrote:

>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...
>    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.
Re: Ethernet -- -- -- -- > How to start ?
#2049
Author: Michel Leunen
Date: Tue, 29 Aug 2006 15:13
16 lines
1328 bytes
Ori wrote:

> 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/
----------------------------------------
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads