Thread: Visual Basic Winsock client and Linux server with C? Is it easy?

  1. #1
    Registered User
    Join Date
    Feb 2008
    Posts
    6

    Visual Basic Winsock client and Linux server with C? Is it easy?

    I have a program under Windows programmed with Visual Basic and Winsock. And I want to programm a server for that program under Linux with C. And I want ask, is is easy to do or not? I havent programmed networking programms with C much, but I have some C experiences under Linux.

  2. #2
    Frequently Quite Prolix dwks's Avatar
    Join Date
    Apr 2005
    Location
    Canada
    Posts
    8,057
    Well, network programming has lots of nuances and it isn't all that easy. But I don't think that writing a Visual Basic Winsock client would have been easy, either. It should be do-able. Why don't you try it?

    Here's a good place to start: http://beej.us/guide/bgnet/

    (BTW -- next time, consider posting in the Network Programming forum.)
    dwk

    Seek and ye shall find. quaere et invenies.

    "Simplicity does not precede complexity, but follows it." -- Alan Perlis
    "Testing can only prove the presence of bugs, not their absence." -- Edsger Dijkstra
    "The only real mistake is the one from which we learn nothing." -- John Powell


    Other boards: DaniWeb, TPS
    Unofficial Wiki FAQ: cpwiki.sf.net

    My website: http://dwks.theprogrammingsite.com/
    Projects: codeform, xuni, atlantis, nort, etc.

  3. #3
    Algorithm Dissector iMalc's Avatar
    Join Date
    Dec 2005
    Location
    New Zealand
    Posts
    6,318
    If you mean that you were using a winsock control in VB6, then know this that your program already will not ever run under Vista.

    If your only question is whether it is easy or not, then I would have to say, most probably not, certainly not as easy as it was in VB.
    My homepage
    Advice: Take only as directed - If symptoms persist, please see your debugger

    Linus Torvalds: "But it clearly is the only right way. The fact that everybody else does it some other way only means that they are wrong"

  4. #4
    Registered User VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,607
    Writing a Winsock client in C is actually quite simple. But without writing a server your client prob won't do much. Writing a multi-threaded server in C is also equally as simple. If you know a little bit about winsock the MSDN docs ought to do just fine. Plus there are tons of examples on the internet for winsock.

  5. #5
    Algorithm Dissector iMalc's Avatar
    Join Date
    Dec 2005
    Location
    New Zealand
    Posts
    6,318
    Quote Originally Posted by Bubba View Post
    Writing a Winsock client in C is actually quite simple. But without writing a server your client prob won't do much. Writing a multi-threaded server in C is also equally as simple. If you know a little bit about winsock the MSDN docs ought to do just fine. Plus there are tons of examples on the internet for winsock.
    If he's done what I think he's done in VB, and used a winsock control component, then it only takes a dozen lines of code to get something reasonable to work, half of which the IDE creates for you.

    Now, if you can compare that to writing a multi-threaded server in C and call it equally simple, then I've been doing something horribly wrong all this time.
    This doesn't sound to me like someone who would find it easy:
    I havent programmed networking programms with C much, but I have some C experiences under Linux.
    My homepage
    Advice: Take only as directed - If symptoms persist, please see your debugger

    Linus Torvalds: "But it clearly is the only right way. The fact that everybody else does it some other way only means that they are wrong"

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 2
    Last Post: 11-23-2007, 02:10 AM
  2. problems with linux UDP server
    By Lopizda in forum Networking/Device Communication
    Replies: 5
    Last Post: 04-26-2007, 08:42 AM
  3. Linux (not programming) E-mail server question.
    By Kennedy in forum Tech Board
    Replies: 4
    Last Post: 11-09-2006, 02:08 AM
  4. Winsock in C and in Linux?
    By 3D-Realitycom in forum Linux Programming
    Replies: 3
    Last Post: 08-06-2004, 02:32 PM
  5. Linux: Sample: Client - Server (Connection Error)
    By zahid in forum Networking/Device Communication
    Replies: 3
    Last Post: 09-07-2003, 05:32 PM