Sockets?...Libraries!
Author |
Message |
Apage43
|
Posted: Sat Nov 22, 2003 7:10 pm Post subject: Sockets?...Libraries! |
|
|
What's a good socket library for C++?
If not cross-platform, *nix compatible, please. |
|
|
|
|
![](images/spacer.gif) |
Sponsor Sponsor
![Sponsor Sponsor](templates/subSilver/images/ranks/stars_rank5.gif)
|
|
![](images/spacer.gif) |
Dan
![](http://wiki.compsci.ca/images/archive/3/3c/20100325043407!Danspic.gif)
|
|
|
|
![](images/spacer.gif) |
wtd
|
Posted: Tue Apr 06, 2004 10:04 pm Post subject: (No subject) |
|
|
This might be better done in a higher level language, too. Perl, Python, Ruby... any of those will give you socket capabilities that will work pretty much anywhere. And the code's heaven too.
code: | require "socket"
$port = 12000
server = TCPServer.new($port);
Thread.start(server.accept) { |client|
client.puts("hello world!")
client.close
}
client = TCPSocket.new("localhost", $port)
puts client.gets |
A simple server (only accepts one connection) and a client in 13 lines of code that will work on *nix (Linux, BSDs, Mac OS X, Solaris, AIX, etc.) and Windows.
Anyway, just a thought. |
|
|
|
|
![](images/spacer.gif) |
|
|