Jump to content

Featured Replies

Posted
ive searched over google for hours trying to find a winsock tutorial....anyone know a good site to a winsock tutorial using C++ n not visual C++ or any other language...also it would be good if the site contained files tat i might need to include while doing winsock projs.. thnx
winsocks is a C API, and thus can be used by C++. Visual C++ is an IDE, and not a language. If your looking for a C++ wrapper there are plenty (i.e. Socket++, ACE Framework, etc). Also, other than a few extra differences, it wouldn't be hard to use a BSD socket tutorial and comform it to windows sockets.
Well, Beej's Guide is pretty good to get a taste of socket programming, but I'd suggest one of Steven's books such as Unix Network Programming for the long term. Obviously the code isn't going to complete cross over since its written for Unix, but he was one of my favorite author, and many people will agree.

use c# and .NET cos thats easy as 123 to create shit like that

 

static void Main(string[] args)
{
string rqst = "GET /index.html";
string host = "localhost";
int port = 80;	// Default port for Web servers

// Create a client socket connected to port 7 on the local machine
TcpClient client = new TcpClient(host, 80);

// Construct IO streams on the TcpClient's network stream
NetworkStream nStream = client.GetStream();
StreamWriter sOut = new StreamWriter(nStream, System.Text.Encoding.ASCII);
StreamReader sIn = new StreamReader(nStream, System.Text.Encoding.ASCII);

// Send HTTP request to the server
sOut.WriteLine(rqst);
sOut.Flush();
		
// Read the server's response
string msgIn = sIn.ReadToEnd();
Console.Out.WriteLine(msgIn);

// Close the network streams
sOut.Close(); sIn.Close(); nStream.Close();
}

  • Author
lol wow tat looks realy easy to understand...o well i think ill stick to C++ n finish learning sockets b4 moving on to C#...o yea is everything in Unix a file?
Yes, and thinking of everything as a file helps simplify programming. This allows you to treat devices, IPC, and files in a generic fashion using basic file IO. You could even read and write to socket connections, which passes a file descriptor on unix (which is unsigned integer passed from the kernel), using the basic IO systems calls such as read and write instead of send and recv.
C++ dont have serializable and well if your sending alot of data backwards and forwards from machine to machine your better of using a language that has that, otherwise your gonna have to write all your own interpritation stuff when the data gets there, instead of just sending an object
There is plenty of ready made libraries that offers seralization for you, and many that will be much more portable. A good example of such a library that offers serialization is Boost. Also serialization is a .NET feature (not a C# feature), so you could just use the framework's if portablitly isn't an issue.
not visual C++ or any other language

Can you show me some visual c++ syntax please? I have never seen it and am quite interested.

  • Author
download MS VC++ from MSDN sites....the syntax is very similar but a bit different...
I fail to see how, or why for that matter. What would be the advantage of making a compiler that won't work with conventional programming practices?
visual C++ and C++ are the same thing u r the most retarded person ive ever met, and also you seem to enjoy calling yourself l33t, and then asking a fucking n00bish question three seconds later. also learn to not post every 5 seconds. half the posts on this forum are from you :dfinger: :fawk: psh :owned:
  • Author
i have no clue....the syntax wasnt all tat different...just tat if u put replace i forgot wat the code was...with int main()..it returns an error
Guest
This topic is now closed to further replies.