C-Windows-Socket-(Client/Server)

This is a discussion on C-Windows-Socket-(Client/Server) within the Networking/Device Communication forums, part of the General Programming Boards category; Hi, i am new to this board and start with a question. I am trying to set up a Windows ...

  1. #1
    Registered User
    Join Date
    Aug 2009
    Posts
    2

    C-Windows-Socket-(Client/Server)

    Hi,
    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
    Posts
    28
    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
    and
    - WSACleanup() after you are done using winsock

    tutorials:
    - Winsock Networking Tutorial (C++) - MadWizard.org
    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 http://www.madwizard.org/download/sock2.zip

    - 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 10:21 AM.

  3. #3
    Registered User
    Join Date
    Aug 2009
    Posts
    2
    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
    Location
    California
    Posts
    3,265
    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-06-2009, 12:05 AM
  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, 10: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, 06:31 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21