Jump to content

TCP connections


olivarra1
 Share

Recommended Posts

i've googled a lot trying to find how to make a c or c++ TCP/IP server in Windows, but i found nothing.

Then thinking and thinking i remembered that Autoit has functions to make TCP connections, and i thought asking here maybe somebody will know.

Now the question: is there any way to make a c++/c TCP server for windows?

thank you very much,

Olivarra1

Link to comment
Share on other sites

It doesn't mater what editor you use. You just need the appropriate header files. If you plan on writing Windows applications, you'll need the Windows SDK. http://msdn.microsoft.com/en-us/windows/bb980924.aspx

This is a set of headers, libraries, and compiler tools for building Windows applications.

If you don't even know this much, you have more to learn about coding in C++ before you try building anything.

Link to comment
Share on other sites

Oh well, i just have 1 year programming in c++, i learned in university, using linux for making console applications.

I've never done a windowed app., but i don't want to do that. just i want to do a console-like app. (that you run it with cmd).

what i mean:

#include <iostream>
#include <string>
using namespace std;

int main(){
  cout << "hello, how're u?" << endl;
  string response;
  cin >> response;
  return 0;
}

Then including If's, For's, While's, some classes, etc..

and what i want to do it's just a game server, the game is made with Flex + Flash.

Right now i've made the server in PHP, but i wonder if in C++ would be faster and use less memory.

olivarra1

edit: ohh btw, i've found how to include the sockets library. now i just need to see how does it works (functions that it has, etc.)

Edited by olivarra1
Link to comment
Share on other sites

Yeah, you want to look at network sockets. In particular you want to create a network listener. A quick search turned up this site which talks about setting up a listener in Linux. The Windows implementation is based on the Unix implementation, so most of this should work or at least give you ideas about what you need to do. Also, this site gives a pretty good explanation of what happens during client-server operations and gives some coding tips.

David Nuttall
Nuttall Computer Consulting

An Aquarius born during the Age of Aquarius

AutoIt allows me to re-invent the wheel so much faster.

I'm off to write a wizard, a wonderful wizard of odd...

Link to comment
Share on other sites

  • 1 month later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...