Sowe'reactuallygoingtosendinformationtotheclientsocket, which I feellikeisweird, Liketheclientsocketis a socketobject, butit's like a foreignsocketobjects, sowe'regoingtosendinformationtoit, But I almostfeellike I don't know, itwouldmakemoresensetomeif, like, wedid s dotsendandthenwepassedinclientsocket.
Youalsocouldjustdolike a stringandthendotandcodeorwhatever.
Anyway, istheretosay, here, welcometotheserver.
Andthenwhattypeofbitesarethese?
Theseairutfbitesutfeightbites.
Sonowthat's prettymuchallweneedtodotosendsomeinformation, so I'llsavethat.
Now, thisisnotnearlyenoughforregularuse, Butthis a basicexamplesbasebecause I couldmakeit.
Sonowwe'regonnaworkonourclientdotpies.
Soagain, clientismuchlikeserver.
It's gonnausethesameexactsocket.
So I'm actuallygonnacopypastethatinformationnow, thissocketratherthanbindinginstead, whatthissocketreallywantstodoisconnect, Sowe'regonnasay s dotconnectandthenwepass a topullagainofthe I p intheportthatwewishtoconnecttointhiscase.
It's socketdotGethostnameandthe I P sameis 41234 Nowoftenisthecase.
Yourclientwillbelikeremotetoyourserver.
Itwon't actuallybeonthesamemachine.
Sowithsocketsyoucancommunicatetoandfrompythonprogramsonthesamemachineon, like a locallynetworkedsetofmachinesorevenremotelynetworkedmachines.
You'reprobablylookingfor a morelongtermconnection, butwecouldjust, like, keeprunningthatagain, likeeverytimewewantedtoreceive a bitofinformation, butthat's kindofsilly.
Mostpeoplearen't actuallydoingthatwithsockets.
They'regoingtobedoingsomethingfarmorecomplex.
So I thinkthelastthing I wanttoshowyouguysbeforewe, uh, leaveandgotolike, thenextvideois, um, youknow, thewaythattrulysocketsaregonnaworkinthewaythatyouknow, you'reactuallygonnabebufferingdataismostofthetime.
So I'm gonnasetthistoeeightandthenhitsavefortheclient, and I honestlydon't remember, didwe, uh, don't yetknowwehaven't doneanythingtotheserver, so I'llleavetheserverrunning.
Now, wecouldkindoftreatthislike a restful a p i orsomething, andlikebuilddatauntiltheclientreconnects, acceptsthebufferandthenclearsoutwiththeclientGodorsomethinglikethat.