Added: 3 years ago
From: LusikkaMage
Views: 29,799
Sort by time | Sort by thread (beta)

Link to this comment:

Share to:

All Comments (79)

Sign In or Sign Up now to post a comment!
  • How would I add libws2_32.a to visual studios 2010? It's a linker file, yes?

    I'm getting these weird errors that consist of " 1>Socket.obj : error LNK2019: unresolved external symbol __imp__socket@12 referenced in function "public: __thiscall Socket::Socket(void)" (??0Socket@@QAE@XZ)"

    and whatnot

  • I got a question

    I got the code and it works, and now I want to have that client window on an other laptop, for now I want a LAN connection but how can I do that?

    I gave my both laptops their own IP adress, but my still can't find the host ;(

    Do you know how to make that LAN network?

  • Please show us a (or is it an?) UDP example!

  • I'm using winsock and it randomly puts winsock 2.0 with a bunch of smiley faces in the data i send..........................­..... wtf

  • One thing I haven't gotten with Winsock, is getting it to run over a WAN. On my home network it ran fine., but I once tried to get it to work over internet, and it didn't work. Also file transfer is something I haven't gotten to.

  • What's the point of the SendData() function? It returns true - but it always returns true no matter if send() failed or not, why is it not checked?

    if( send( ... ) != SOCKET_ERROR )

    return true;

    else

    return false;

    ??? I have to say I first was positive about this tutorial and thought it was better than those out there in the internet but I get disappointed more and more..

  • @mySaigaAntilope It was pretty incomplete, yes. I'm sorry for the quality, it is quite old, and back then it was hard to get anybody to peer review my tutorials. Hopefully what I release in the future will be better quality, once I have time again to make tutorials (really busy w/ full time software engineering jobs since I've been out of college).

  • iostream? lol. I use conio and stdio

  • @vitorix24 So you're writing C code and not C++ code.

  • @LusikkaMage It's just libraries. C and C++ it's almost same thing. =D

  • @vitorix24 No no no no no no no. C++ is much more than an extension of libraries on top of C. C++ is a completely different language, and while C is compatible with C++, C++ is not compatible with C.

    C++ is a multi-paradigm language, so on top of your basic C functionality it also includes Object Oriented designs as well as Templating.

    Polymorphism, Encapsulation, Inheritance, all are parts of C++ that are not parts of C, and using C++ with only C functionality is a waste of the language.

  • @LusikkaMage ahhh... ok ok ok ... If you tell, it's true.

    I'm studing Programming and Network at school , and i'm almost complete the first year. =D

    thanks for asnwer :D

  • @LusikkaMage What's your thought on C99?

  • @vitorix24 get your facts right ^^

  • You have a new subscriber. Congrats.

  • thank you so much Lusikka. you help me for finishing my assignment in socket programming.. :))))

  • thank you so much Lusikka. you help me for finishing my assignment in socket programming.. :))))

  • Thank u

    Master =P

  • Very useful thanks :)

  • hey i am learning game programming and stuck how a server handles connections

  • thanks man

  • i have Dev-C++ and i have debug error:

    "Build Error, sample, Error 1"

    Please help

  • Been looking for 3 days... think this will be what helps me create my own working socket program. Much love.

  • *V£Ry•CoOL™

  • nice video, but you shouldn't use a namespace in a header file

  • ALT+P-> Linker Settings -> Compiler Settings (on the left) -> "Dev-C++/lib/libws2_32.a"-> ok

  • Very Easy:

    Click on Project Options or STRG + P, then in the Tab Linker settings, on the left click "add" or so.

    Then you select your linkfile ("Dev-C++/lib/libws2_32.a") and click ok

    Very easy^^

  • Awesome videos lusikkamage. One small problem though. When I try connecting to another computer via IP address, I'm still able to type messages and send them but the other computer doesn't seem to be recieving them. Any ideas why? Tried playing about with firewall but to no avail :(

  • please, how can I link libws2_32.a in Dev-C++ ?

  • how i can link the dll in visual c++ 2008?

  • This tutorial gave a good start for me, thx a lot.

  • Socket programming is almost in a league of its own. I use the Windows API regularly and anytime I look at Winsock functions, they seem to be very different.

  • it never ceases to depress me how little i know.

  • Don't worry, compared to someone else, we ALL know barely anything =D

    I've been programming and developing Internet programs for years, but I've ALWAYS wished I knew how to program and do 3d graphics rasterization and rendering like John Carmack or even Ken Silverman; but I just don't have the time (or the patience) ='P

  • know it alls have been known to forget it all

  • I downloaded the code and tried to compile in Dev and it didn't work

  • Nor when I did it in code blocks..

  • A very nice example, though the dots and the : are very hard to notice.

    However, the project files are uploaded and many thanks for that. It's very hard to to program with sockets, hard to understand..

    However, winsock does not work with linux, the two library's are very similar but you should have included that in this tutorial. Programming for 1 O.S. just isn't the way to go.

  • Nice one.. thnks!!!

  • This tut includes everything, thanks for it :D

  • Thank you for this tutorial, I am working on a multi-player game in C++ but I have been struggling a little with WinSock, this really helped me! I have subscribed!

  • Was looking for socket tutors, Thank You Lusi!

    Using std in your code just doesn't sound right anymore...

  • I've been looking for a c++ sockets video, thank you Lusikka.

    I wanted to give you a cookie, but I eated it!!

  • You bastard! D:

    Jk!

    Thanks. ;D

  • Is there any way to remake this console chat program to a chat program with GUI?

  • Yeah, but if you don't already know how to create a GUI in C++ you should probably research that first, either using Visual Studio's tool, something like wxWidgets, or writing your own with Allegro/SDL.

  • I know how to create a GUI, but I think I can't use blocking sockets in GUI, so what can you offer? Maybe Async? I've been googling for sockets in GUI using C++, but there are many tuts using VB - not C++.

  • I don't know very much about sockets and such, when I used it for a game I was working on I used blocking sockets, but my program was multithreaded so it'd run the socket stuff on a separate thread.

  • So maybe you know where I can find a good tut about thread and socket programming because I don't know what thread is ;D Thanx

  • If you're familiar with SDL at all, Lazy Foo's tutorial site has multithreading intro stuffs.

  • nice, thanks for this tutorial. I have been socket programming in C# and I am starting to move onto C++ now. It is really hard for a 15 year old though, are you self taught? or did you go to school?

  • I have gone to school for CS, though I haven't taken their socket course. I learn some through school, I learn some through the internets.

  • @HordeAreMyFatCousins Why dod you assume a 15 year old? From the voice i think it's a woman with quite a lot of knowledge about programming. No pun intended at all.

    I could be wrong though.

  • @farmdve She's a 23-years-old female, as you can see in her profile.

    But anyway, i have to see i saw the tutorial relative to this video, in written text.

  • you can use threads.

    With Qt for example...

  • This is very nice of you to take time out to help beginners. It would be very cool to see you take it further - maybe make a game lobby then once all clients are connected switch to UDP for the main game - but only if your not too busy :-P

  • Is there any way to remake this program in a chat app like skype? I mean that you would be able to write another message right after the first one, that you don't have to wait for a message from another user.

  • One thing I want to know... you may be able to answer my question.

    If I write a client and a server in C++ and that I want the client to call functions that are on the server, how do I do that?

    Is it something as much retarded as a switch/case to know what function I want to call using the parameters I sent from the client?

    I hope you can guide me :(

  • yea thats the way

  • thanks i really wanna learn this

  • noticed your mouse pointer is sorta scary :D

  • It's the cursor from Psychonauts (Raz's hand) that I ripped and made into my cursor, heh.

  • well your a very good coder, iam just starting to learn c++, and its easyer than i tought it would be, and its sorta giveing me insight of all those games i used to play.. its quite interesting realy :)

  • where we can find this code plzzzz

  • Description.

  • whee!

  • Wheeeheeeeheeee!! :D :D :D

  • cool video (:

  • Hey lusikk!

    I have a question...

    I want to start learning about this kind of stuff (Online apps) because I want to make an Online game in the future. What should I learn? Should I stick with winsock? Or maybe search for another Networking Lib?

  • If you're game is going to be something like a MUD, you will need to know 3 things, through and through.

    1. Standard C++ Syntax

    2. Winsock API (for server and client)

    3. Multithreading(so asynchronous connections).

  • is winsock available for linux

  • No, but there are just plain sockets. They're pretty similar, just google.

  • just use the standard c++ decompiler plz

    i hate codeblocks

  • How about I use whatever I want to use?

    That sounds better to me.

  • Must be that time of month again...

    Yea really... VC08 should be used... Or is it too complex for you?

  • Kind sir, VC08 is a Microsoft product. I prefer to use stuff that is open source, because that's more of what I stand for.

    I also stand for blocking idiots posting on my channel. :)

  • DANG female programmer , that never happens! Good to see!

  • Good tutorial. Why did you give a direct refrence to the lib? With codeblocks using GCC You can just as easly type ws2_32 and it will find it by scanning your dir's

  • Do you find code blocks is good to create apps with?

  • I like it.

  • What compiler is this?

  • Using Code::Blocks

  • sadly ive decide to back down from allegro and SDL and decided to do DirectX 9...then recently(now) im doing XNA C# ...its extrememly OOP but still awesome ;)

  • C# is an insult to programming......

    So let me get this straight...

    You started w/ C++ and Dx9

    then you 'upgraded' to C# to XNA...

    Yes that makes sense...

  • well sometimes you just have to try new things out...plus i wanted to aim towards xbox deving and i have to agree with you...C# is an insult thats why im back in good ol C++ ^^

  • i wud have to say c# makes all things c easier... lovin c# and xna

  • Ehh..  I'm playing with XNA because I'd like to make something for the xbox, but otherwise it doesn't offer enough control and isn't the type of thing you'd use to make games that run on Mac and Linux.

  • I think you're an insult to programming, guy. Stop flinging your shitty opinions around and attacking me and my subscribers.

    I'd say fuck off, but you really don't have a choice as you're blocked now. :P

  • wow lol

  • yee who ventures into the land of winsock will either perish...or come out an hero!!!

    freaking Win Tutorial

  • Har! I do not know the meaning of "perish"!

    There's no way I can back out of this now that I've announced to my class that I'm going to be doing a multiplayer winsock game in C++. XD

    More complex tutorials to come as I learn more and have time.

  • So this is what you've been up to...

    I made something similar about two months ago, to communicate to a server and control robots. It was quite an experience. And I only crashed the robots' systems twice! : )

Loading...
Alert icon
0 / 00Unsaved Playlist Return to active list
    1. Your queue is empty. Add videos to your queue using this button:
      or sign in to load a different list.
    Loading...Loading...Saving...
    • Clear all videos from this list
    • Learn more