TCP Client Server Implementation in C | Socket Programming in C

แชร์
ฝัง
  • เผยแพร่เมื่อ 3 ต.ค. 2024
  • This video will implement TCP client-server architecture in the C programming language, where both the client and server can communicate with each other.
    TCP refers to Transmission Control Protocol, a standard that defines how to establish and maintain a network conversation through which application programs can exchange data. TCP works with the Internet Protocol (IP), which defines how computers send packets of data to each other.
    CODE: github.com/nik...
    Join this channel to get access to perks:
    / @idiotdeveloper
    MY GEARS:
    Intel i5-7400: amzn.to/3ilpq95
    Gigabyte GA-B250M-D2V: amzn.to/3oPuntd
    ZOTAC GeForce GTX 1060: amzn.to/2XNtsxn
    LG 22MP68VQ 22 inch IPS Monitor: amzn.to/3soUKs5
    Corsair VENGEANCE LPX 16GB: amzn.to/2LVyR2L
    WD Green 240 GB SSD: amzn.to/3igt1Ft
    1TB WD Blue: amzn.to/38I6uhw
    Corsair VS550 550W: amzn.to/3nILHi3
    Zebronics BT4440RUCF 4.1 Speakers: amzn.to/2XGu203
    Segate 1TB Portable Hard Disk: amzn.to/3bF8YPG
    Seagate Backup Plus Hub 8 TB External HDD: amzn.to/39wcqtj
    Maono AU-A04 Condenser Microphone: amzn.to/35HHiWC
    Techlicious 3.5mm Clip Microphone: amzn.to/3bERKSD
    Redgear Dagger Headphones: amzn.to/3ssZNYr
    FOLLOW ME:
    BLOG: idiotdeveloper... sciencetonight...
    FACEBOOK: / idiotdeveloper
    TWITTER: / nikhilroxtomar
    INSTAGRAM: instagram/nikhilroxtomar
    PATREON: / idiotdeveloper

ความคิดเห็น • 45

  • @diegosuarezcarranco2086
    @diegosuarezcarranco2086 ปีที่แล้ว +7

    you gave a great in depth example of this. Amazing Job

    • @IdiotDeveloper
      @IdiotDeveloper  ปีที่แล้ว +2

      Glad it helped!

    • @mbongmendzuiofficiel3371
      @mbongmendzuiofficiel3371 ปีที่แล้ว

      Hello please how to modify the codes so that I can run both the server and client from 2 differents computers in order to get the same result?
      THANK YOU SO MUCH

    • @mbongmendzuiofficiel3371
      @mbongmendzuiofficiel3371 ปีที่แล้ว

      @@IdiotDeveloper Hello please how to modify the codes so that I can run both the server and client from 2 differents computers in order to get the same result?
      THANK YOU SO MUCH

  • @SanjeevKumar-cj7cl
    @SanjeevKumar-cj7cl 2 ปีที่แล้ว +25

    Bro its nice that you have written a code but for clarity purpose you should first explain why we are writing this so, that we can able to make the connection then only we are able to understand the code properly.

    • @mbongmendzuiofficiel3371
      @mbongmendzuiofficiel3371 ปีที่แล้ว

      Hello please how to modify the codes so that I can run both the server and client from 2 differents computers in order to get the same result?
      THANK YOU SO MUCH

  • @PTeja-tr1qw
    @PTeja-tr1qw 2 ปีที่แล้ว +11

    Nice Video!!. Please give explanation while adding the functions, why this was function was added/used.

  • @firepower01
    @firepower01 ปีที่แล้ว +2

    Thank you! Was stuck on an assignment like this for school.

  • @OliverWells-ly6zu
    @OliverWells-ly6zu 10 หลายเดือนก่อน

    Very useful and clear, thank you!

  • @sen7826
    @sen7826 2 ปีที่แล้ว +11

    Sir with all due respect you are just narrating what you are typing, there is almost no explanation, how is that better than just looking at the code?

  • @exapsy
    @exapsy 9 หลายเดือนก่อน

    i expected a sock_dgram with your own custom implementation, but fair.

  • @akashbhandary3799
    @akashbhandary3799 2 ปีที่แล้ว +3

    Good video, can you explain some lines like y do you use it etc....( In depth) . Or did you do it in other video?

  • @meanpillscasper
    @meanpillscasper 2 ปีที่แล้ว +1

    Thank you very much, sir.

  • @drondasgupta9378
    @drondasgupta9378 3 ปีที่แล้ว +3

    Thanks very much!

  • @shashankshah383
    @shashankshah383 2 ปีที่แล้ว +1

    Excellent work thanks for this video👍❤️

    • @bangsame121
      @bangsame121 2 ปีที่แล้ว

      hey bros, my #include library is being wrong, i dont know why ?

    • @ZMinaam
      @ZMinaam 2 ปีที่แล้ว

      @@bangsame121 same here bro, u have any idea how to correct it?

  • @incodewetrust8862
    @incodewetrust8862 ปีที่แล้ว +1

    i have connect command in a function that returns 0 i call it in an infinity while(1) when ever the server closes connection after some exchange but once the server close connection the program breaks out from the while loop is that normal ?

  • @Pages_Perfected
    @Pages_Perfected ปีที่แล้ว +2

    love software eng

  • @anson2416
    @anson2416 ปีที่แล้ว

    Nice job. May I know how to set proxy with C?thanks

  • @mbongmendzuiofficiel3371
    @mbongmendzuiofficiel3371 ปีที่แล้ว

    Hello please how to modify the codes so that I can run both the server and client from 2 differents computers in order to get the same result?
    THANK YOU SO MUCH

    • @NehaPagare-m8t
      @NehaPagare-m8t 7 หลายเดือนก่อน

      I am trying the same do you got any modifications

  • @dynatrace7476
    @dynatrace7476 2 ปีที่แล้ว

    Can you show how server sent random number 100-999 to client/server ?

  • @rajubai0077
    @rajubai0077 7 หลายเดือนก่อน

    How to interface client in other state and server in other states how to connect is tha program work

  • @janeturk4881
    @janeturk4881 2 ปีที่แล้ว

    Please how can I change the client and the server programs so that the server responds with the current time of the day if the received text from the client is "What's the time?".

  • @shubhammulik3178
    @shubhammulik3178 2 ปีที่แล้ว

    how to keep client always in accept mode , like the server is always in listning mode.

  • @suryasreedharreddy2277
    @suryasreedharreddy2277 2 ปีที่แล้ว +2

    How can we do in two machines like server in one and client in another machine

    • @jaiemandi502
      @jaiemandi502 2 ปีที่แล้ว +1

      Same quation , I have two cilents how can I send data at particular cilent

    • @AbhipreyaGhosh
      @AbhipreyaGhosh ปีที่แล้ว

      Yes we can do that . For that case we need to also change little endian to big endian that is byte ordering .And take the other machines ip as input from command line .

  • @jaiemandi502
    @jaiemandi502 2 ปีที่แล้ว

    I have two clients that connected to one server with same port number and I want to read data from one client at same time , I want to write data in another client , what can I do how can I write data in one particular client ....

  • @dolevdo
    @dolevdo 2 ปีที่แล้ว

    amazing!

  • @coolie_life
    @coolie_life 7 หลายเดือนก่อน

    Hello sir
    This code will be work for this below question can you confirm plss
    Write a C program to make the TCP server to receive a request, to process the request, and to send back the response. Allow the client to provide the pathname of a short file stored on the server host. The server needs to send the contents of the short file as a string of characters. The client stores the file at the client host.

    • @vb9950
      @vb9950 6 วันที่ผ่านมา

      If this is a interview question, please reject yourself.

  • @snehadeepgolui3757
    @snehadeepgolui3757 5 หลายเดือนก่อน

    bro There is an error showing in arpa/inet.h please help

  • @anmolparmar2732
    @anmolparmar2732 ปีที่แล้ว

    Sir I have query can we send multiple messages during a single connection between client and server?

    • @solebridge
      @solebridge ปีที่แล้ว

      Put the send/accept code into a loop

  • @gllllll6
    @gllllll6 2 ปีที่แล้ว

    What if i want to get the transfer speed?

  • @bodalajahnavi6272
    @bodalajahnavi6272 3 ปีที่แล้ว +3

    Can we do in windows or Mac OS system rather than linux

    • @AdnanAli-yd6rg
      @AdnanAli-yd6rg 3 ปีที่แล้ว

      Same question sir

    • @tekbssync5727
      @tekbssync5727 2 ปีที่แล้ว

      yeah you can run in the WSL bash in windows

  • @mrafayshams3089
    @mrafayshams3089 ปีที่แล้ว

    How can we make it work with the internet rather than local connection?

    • @solebridge
      @solebridge ปีที่แล้ว

      I think you just change the IP/port

  • @MangoZeo
    @MangoZeo ปีที่แล้ว

    13:22