Thread: C-Windows-Socket-(Client/Server)

  1. #1
    Registered User
    Join Date
    Aug 2009


    i am new to this board and start with a question. I am trying to set up a Windows Client/Server Application written in C. What i found so far is how to set up a Linux connection. But the requirement is to use Windows XP and i do not find any solution. Maybe someone would be so kind and give some help to me.

    Best Regards

  2. #2
    Registered User
    Join Date
    Jan 2009
    hi and Welcome EyesOnly,

    on windows, winsock has a similar API.
    by connection i assume you mean you want to use TCP.

    one of the differences is, on windows you have to call:
    - WSAStartup() before you call winsock functions
    - WSACleanup() after you are done using winsock

    - Winsock Networking Tutorial (C++) -
    i liked this one because its nice and short. i used mainly this one (but it's not complete if you are planning to use non-blocking sockets) it also has a really useful ( but a bit old ) reference manual of winsock 2 which helps alot

    - Beej's Guide to Network Programming
    and i used this one a little ( its for linux but the API is very similar )

    maybe you could be a bit more specific about your exact problem
    Last edited by symbiote; 08-04-2009 at 09:21 AM.

  3. #3
    Registered User
    Join Date
    Aug 2009
    Thanks for your help. What i am planning to do is to creat a piece of software that communicats over ethernet via TCP (prefered) using a Windows OS. For this communication i need a Server that listens on a special port for requests and a client that creates requests and get response from the server. I wrote such a piece of software in Jave there it is very easy to port it from linux to windows because of platform independency. If you like i can post my Java source code it is very similar to the to what i m planning to do in C. The client and server shall be used for vertical cross communication between some PCs that control modules of a machine. And these client and server shall communicate to start and stop the single modules when they have to wait for the next one (The communicaton with the machine is non-ethernet-communication)

  4. #4
    Registered User
    Join Date
    Sep 2004
    I don't see how posting your java code here will get you any closer to a solution (unless you are hoping someone will just do the port for you).

    You need to read the links posted up above, and then start writing code. You can post questions here when you run into any specific problems that you encounter, and we will help you with those.
    bit∙hub [bit-huhb] n. A source and destination for information.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Problem with simple socket client/server program
    By spencer88 in forum C Programming
    Replies: 6
    Last Post: 05-05-2009, 11:05 PM
  2. Just starting Windows Programming, School me!
    By Shamino in forum Windows Programming
    Replies: 17
    Last Post: 02-22-2008, 08:14 AM
  3. how to make a windows application
    By crvenkapa in forum C++ Programming
    Replies: 3
    Last Post: 03-26-2007, 09:59 AM
  4. Question..
    By pode in forum Windows Programming
    Replies: 12
    Last Post: 12-19-2004, 07:05 PM
  5. IE 6 status bar
    By DavidP in forum Tech Board
    Replies: 15
    Last Post: 10-23-2002, 05:31 PM