Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

winsock programming in GNU c++

2 views
Skip to first unread message

noddoplay

unread,
May 9, 2000, 3:00:00 AM5/9/00
to
Is it possible to program winsock in GNU's c++ compiler?

I downloaded the compiler here:
http://sourceware.cygnus.com/cygwin/

noddoplay

unread,
May 9, 2000, 3:00:00 AM5/9/00
to
problem solved, and the answer was found at:

http://www.cyberport.com/~tangent/programming/winsock/

EX: compile with

g++ -c "prg.name".cpp
g++ "prg.name".o -lwsock32 -o "prg.name"

your program should include winsock.h


noddoplay <c97...@student.dtu.dk> skrev i en
nyhedsmeddelelse:8f8c9a$asj$1...@nevald.k-net.dk...

Rob

unread,
May 11, 2000, 3:00:00 AM5/11/00
to
On Tue, 9 May 2000 08:46:06 +0200, "noddoplay"
<c97...@student.dtu.dk> wrote:

>Is it possible to program winsock in GNU's c++ compiler?
>
>I downloaded the compiler here:
>http://sourceware.cygnus.com/cygwin/
>
>

Im sure you can, but if you are using cygwin, you know you can use
Berkeley sockets, you have it already..just include the .h files, and
you are on...

with the cygwin C++ compiler,,just pretend you are in unix (well
almost)....

But if you absolutely need to use WinSock...well...cant help ya..

---rob


---------------------------------------------------
"Give a man a fish, and he eats for a day.
Teach a man to fish, and he eats for a lifetime." - saw it on TV.
---------------------------------------------------
---Rob
rsuh_news@robsuh_nospam_.com
kill the _nospam_ part

SiMON

unread,
May 12, 2000, 3:00:00 AM5/12/00
to
I'm using cygwin, but I'm new in this winsock-thing :).
* What is Berkeley sockets?
* what's the difference between WinSock and Berkeley sockets?


Rob <rsuh_news@robsuh_nospam_.com> skrev i en
nyhedsmeddelelse:391a00d3....@news.mminternet.com...

Lars Gregersen

unread,
May 12, 2000, 3:00:00 AM5/12/00
to
On Fri, 12 May 2000 08:06:33 +0200, "SiMON" <lar...@ostenfeld.dk>
wrote:

>I'm using cygwin, but I'm new in this winsock-thing :).
>* What is Berkeley sockets?

Berkeley sockets are the original implementation of sockets. Think of
them as a phone. A programme (server) may listen for a connection.
Another programme (client) may connect to the sockets. If the server
accepts the connection a new socket is created on which both the
server and the client may send and receive data.

>* what's the difference between WinSock and Berkeley sockets?

Winsock 1.1 and Berkeley sockets are almost the same thing. Winsock 2
is heavily connected with the way Windows handles messages. For large
servers (say more than 1000 connections) this is the way to go. If you
need any kind of portability of your code between Windows and Unix
then stick to Winsock 1.1 and buy a network programming book for Unix.
Note however that there is no problem in making a connection between
Winsock 1.1 and Winsock or Windows and Unix.

Have fun

Lars


------------------------------
Lars Gregersen (l...@kt.dtu.dk)
http://www.gbar.dtu.dk/~matlg
http://members.xoom.com/gregersenweb/

Warren Young

unread,
May 12, 2000, 3:00:00 AM5/12/00
to
SiMON wrote:
>
> * what's the difference between WinSock and Berkeley sockets?

The FAQ covers some of the differences, from the perspective of "how do
I do this BSDish thing under Winsock?"

For the most part, though, it's possible to write code that ports well
between the two platforms. Contrariwise, of course, it's possible to
write sockets code that's a real pain to port between Unix and Windows.
:)
--
= Warren Young, maintainer of the Winsock Programmer's FAQ at:
= http://www.cyberport.com/~tangent/programming/winsock/
=
= ICBM Address: 36.8274040 N, 108.0204086 W, alt. 1714m

0 new messages