Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Search - "socket(s)"
-
Coding has brought me into new communities and is the reason I have some new friends. I have to say, the best part is knowing how things work. I love knowing how this rant is sent to a remote devRant server thru a socket. How my rant gets divided up into an array of characters, each just a string of 0’s and 1’s. How my rant is stored in a database. How the devRant server connects everyone, and how everyone can (if they have to) use a VPN if it’s blocked, etc. And of course, how it’s all done securely. It’s great having that confidence going into the future knowing that you’ll be relevant and you have technological security. I love talking with people and explaining how things work. How when people say “stop acting so smart, you don’t know anything about X,” which to I reply “do you know how many fucking Xs I made.” Coding is great.
-
So, I move house with my amazing, already configured and stable router with built in VPN, DDNS, Port forwarding and DHCP addresses.
Received ISP shitty router at new address and want to use as modem only, so I go read the manual.
"Bridge mode requires you to configure your other router with PPPoE and the ISP's credentials"
Landline is not working, so I cannot call the number to retrieve my password. After 2 days of waiting, engineer visits, installs master socket, dial tone yaaay.
Call number to get password, automated voice message has such a bad sound quality that I cannot figure out if it's saying F or S, and there are two of those letters.
Put ISP router in bridge mode, set other router to PPPoE and put credentials, nothing. Try with F and F, S and F, F and S, S and S... Nothing. Put it back to dynamic IP address, it works.
I resign myself and manually configure everything I had on the good router to the ISP one. A few issues with my server and DDNS, but hey, internet works.
Start missing the other functionality, try the password idiocy again. Nothing.
Next day, go to work, talk to a colleague that lives close and has the same provider: "I just put it into bridge mode and it worked".
Go back home, bridge mode on ISP router, Dynamic IP on good router, no credentials. It works.
Why do I always overcomplicate stuff?4 -
So, my network security faculty thinks s/mime is secure multipurpose internet message encryption. And ssh is secure socket header.
Time to leave the class. 😭1 -
I discovered a language I didn't know AND i like.
It's not under active development anymore, but I decide it has a nice syntax. It's made by the writer of craftinginterpreters. There are still people writing some extensions for it.
I decided to implement socket support in it.
That went very well and the result is just BEAUTIFUL. But now, i have a collection of socket functions that require a file descriptor (sock) for every function like write, read and close. We're not living in the 90's. I want to do sock.send(), sock.write() and sock.close(). So socket as an object.
I wrote a wrapper and it is freaking TWO times slower! Hows that even possible.
I've made wrapping to object optional now. Bit disappointing.
The language shows off with benchmarks on their page. Their fibers can even be faster than Elixr. Yeah, if you only use the fiber and nothing else from language. I benchmarked string concat for example against python: 1000 times slower or so.
The source code of wren is so freaking beautiful. Before Lua was my favorite language regarding source. The extensibility is so great that I prefer to work on this one instead of my own language. They kinda made exactly what I wanted. I can't beat that.
For if you're interested: https://wren.io/
The slot way of communicating between host language (C) and child language (wren) seems odd at beginning but i became fan of it.
Thanks for listening to my ted talk.
What's your opinion about wren (syntax)?25 -
Python3's asyncio is awesome.
In an IoT server we used python2 socket programming with multi-threading. Recently I have changed the socket layer to python 3 asyncio and performance was far better. I am not gonna use multi-threading anymore.
What do you guys think about asyncio?1 -
Can someone please help me with my code below
import socket
s = socket.socket(socket.AF_INET, socket SOCK_STREAM)
s.bind((socket.gethostname(), 6139))
s.listen(5)
while True:
clientsocket, address = s but if I enter . It crashes can someone please help me
Ps this is on Python3IDE1 -
Question about linux iptables. I am currently blocking all access and whitelisting only when my users launch my software. When software is launched a socket client is also launched, it connects to socket server, identifies itself with a password and disconnects. If given password by socket client is correct, then socket server whitelists the users IP by executing the following command: " iptables -I INPUT -s userIP -j ACCEPT".
My problem is that now I have lots of duplicates of IP's whitelisted and as far as I've heard I should not go over 25k iptable rules.
So my question is how to check if ip is already whitelisted, in order to avoid duplicate iptable rules for for same IP?
Obvious solution would be to store whitelist somewhere (mysql/txt) and double check before whitelisting ip, but maybe there is an easier way to do this?4