Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / NewStats: 3,195,586 members, 7,958,815 topics. Date: Thursday, 26 September 2024 at 02:53 AM |
Nairaland Forum / Chillgist's Profile / Chillgist's Posts
Music/Radio / Zubi - Ring Of Roses by chillgist(m): 10:26am On Apr 10, 2020 |
Listen to this new track from Zubi titled ring of roses, a Malaysian based Nigerian artist, dive in to understand why he wrote this song. https:///RoR |
Jobs/Vacancies / Re: Nigeria Custom Service Sent Me This by chillgist(m): 8:17pm On Jan 15, 2020 |
I got a text but please what's the address of abuja exam centre |
Music/Radio / Re: What Music Are You Listening To Right Now? by chillgist(m): 1:22pm On Apr 26, 2019 |
Ruelle - Slip Away |
Celebrities / Re: Top 8 Most Handsome Men In The World (2018) by chillgist(m): 8:53pm On Dec 10, 2018 |
Where's Leonardo di caprio |
Music/Radio / Lykan - Love You by chillgist(m): 9:00am On Oct 31, 2018 |
The wait is over! She's all you've got, whatever it is you want. Let her know how you love her. The much anticipated hit single from Lykan, "Love you" is here. Spread the love and enjoy the beautiful sound of love. Download, Like, Share!!!! Listen Here: https://soundcloud.com/user-335543217/love-you 1 Share
|
Programming / Re: Python Network Programming by chillgist(m): 8:27am On Oct 15, 2018 |
Python Internet modules A list of some important modules in Python Network/Internet programming: HTTP Web pages 80 httplib, urllib, xmlrpclib NNTP Usenet news 119 nntplib FTP File transfers 20 ftplib, urllib SMTP Sending email 25 smtplib POP3 Fetching email 110 poplib IMAP4 Fetching email 143 imaplib Telnet Command lines 23 telnetlib Gopher Document transfers 70 gopherlib, urllib
|
Programming / Re: Python Network Programming by chillgist(m): 8:59am On Oct 13, 2018 |
A Simple Client Let us write a very simple client program which opens a connection to a given port 12345 and given host. This is very simple to create a socket client using Python's socket module function. The socket.connecthosname,port opens a TCP connection to hostname on the port. Once you have a socket open, you can read from it like any IO object. When done, remember to close it, as you would close a file.The following code is a very simple client that connects to a given host and port, reads any available data from the socket, and then exits − import socket s = socket.socket() host = socket.gethostname() port = 12345 s.connect((host, port)) print s.recv(1024) s.close Save this as client.py, save the previous one as server.py and run both simultaneously. Run one in the background using command prompt and the other from your IDE. This should produce a result: Got connection from ('127.0.0.1', 48437)Thank you for connecting
|
Programming / Re: Python Network Programming by chillgist(m): 9:28am On Oct 12, 2018 |
Simple Server To write Internet servers, we use the socket function available in socket module to create a socket object. A socket object is then used to call other functions to setup a socket server. Now call bindhostname,port function to specify a port for your service on the given host. Next, call the accept method of the returned object. This method waits until a client connects to the port you specified, and then returns a connection object that represents the connection to that client. import socket s = socket.socket() host = socket.gethostname() port = 12345 s.bind((host, port)) s.listen(5) while True: c, addr = s.accept() print 'Got connection from', addr c.send('Thank you for connecting') c.close()
|
Computers / Re: Need 500GB Hard Disk For My Mini Laptop by chillgist(m): 10:30am On Oct 10, 2018 |
#45k, Abuja. |
Music/Radio / Re: What Music Are You Listening To Right Now? by chillgist(m): 10:20am On Oct 10, 2018 |
Grant - The Edge
|
Programming / Re: Python Network Programming by chillgist(m): 8:10am On Oct 10, 2018 |
Socket Module To create a socket, you must use the socket.socket function available in socket module, which has the general syntax : s = socket.socket (socket_family, socket_type, protocol=0) Here is the description of the parameters : socket_family: This is either AF_UNIX or AF_INET, as explained earlier. socket_type: This is either SOCK_STREAM or SOCK_DGRAM.protocol: This is usually left out, defaulting to 0. Once you have socket object, then you can use required functions to create your client or serverprogram. Following is the list of functions required : s.bind - This method binds address hostname,portnumberpair to socket. s.listen - This method sets up and start TCP listener. s.accept - This passively accept TCP client connection, waiting until connection arrives blocking. s.connect - This method actively initiates TCP server connection. s.recv - This method receives TCP message s.send - This method transmits TCP message s.recvfrom - This method receives UDP message s.sendto - This method transmits UDP message s.close - This method closes socket socket.gethostname - Returns the hostname. 1 Like
|
Programming / Re: No Scam! Pls Any Online Cbt Script Available? by chillgist(m): 10:33pm On Oct 08, 2018 |
jovialportal: Like I said, chat me up if you want a demo. |
Programming / Re: Python Network Programming by chillgist(m): 9:14am On Oct 08, 2018 |
Sockets 1 Like 1 Share
|
Programming / Re: Python Network Programming by chillgist(m): 9:10am On Oct 08, 2018 |
What is Sockets? Sockets are the endpoints of a bidirectional communications channel. Sockets may communicatewithin a process, between processes on the same machine, or between processes on differentcontinents. Sockets may be implemented over a number of different channel types: Unix domain sockets, TCP,UDP, and so on. The socket library provides specific classes for handling the common transports as well as a generic interface for handling the rest. Sockets have their own vocabulary: The family of protocols that is used as the transport mechanism. These values are constants such as AF_INET, PF_INET, PF_UNIX, PF_X25, and so on. The type of communications between the two endpoints, typicallySOCK_STREAM for connection-oriented protocols and SOCK_DGRAM forconnectionless protocols. Typically zero, this may be used to identify a variant of a protocol within a domain and type. The identifier of a network interface:A string, which can be a host name, a dotted-quad address, or an IPV6address in colon and possibly dot notation. A string "<broadcast>", which specifies an INADDR_BROADCASTaddress. A zero-length string, which specifies INADDR_ANY, orAn Integer, interpreted as a binary address in host byte order. Each server listens for clients calling on one or more ports. A port may be aFixnum port number, a string containing a port number, or the name of aservice. |
Programming / Re: Python Network Programming by chillgist(m): 9:05am On Oct 08, 2018 |
mikezuruki: Alright, that's fine. 08169622682 |
Programming / Re: Python Network Programming by chillgist(m): 12:39am On Oct 08, 2018 |
Python Network Programming 1 Share
|
Programming / Python Network Programming by chillgist(m): 7:57pm On Oct 07, 2018 |
Python provides two levels of access to network services. At a low level, you can access the basicsocket support in the underlying operating system, which allows you to implement clients andservers for both connection-oriented and connectionless protocols.Python also has libraries that provide higher-level access to specific application-level networkprotocols, such as FTP, HTTP, and so on.This chapter gives you understanding on most famous concept in Networking - SocketProgramming. To be continued.... |
Programming / Re: I Need A Very Good Hacker For A Very Interesting Job Life Changing by chillgist(m): 7:36pm On Oct 07, 2018 |
Am willing, I ain't a pro yet but am getting there. |
Programming / Re: No Scam! Pls Any Online Cbt Script Available? by chillgist(m): 7:34pm On Oct 07, 2018 |
jovialportal: Yes, if interested text me on 08169622682. I did it as my master thesis. |
Programming / Re: Real Python Contest by chillgist(m): 9:18am On Sep 07, 2018 |
Politics / Re: PHOTOS: Osinbajo Meets Nigerian Girls That Won World Largest Tech Competition by chillgist(m): 9:05am On Sep 07, 2018 |
is nitda DG dancing shaku shaku? |
Events / Mr/ Mrs Uniabuja by chillgist(m): 9:03am On Sep 07, 2018 |
Here's contestant number 7 of UniAbuja Pageant Contest. [url] https://www.instagram.com/p/BnZwww5hrhy/?utm_source=ig_share_sheet&igshid=1p8yg0z9lovpz[/url] Please support by double tapping. So much love, thanks. |
Programming / Real Python Contest by chillgist(m): 9:34pm On Sep 01, 2018 |
Crime / Road Block At Gwagwalada-abaji Road by chillgist(m): 9:22am On Aug 08, 2018 |
Travellers moving out of the capital city Abuja have been blocked due to protests from tanker drivers. The Nigerian police shot a tanker driver tires and all tanker drivers there have blocked that particular exit from Abuja. Photos below:
|
TV/Movies / Road Block At Gwagwalada-abaji Road by chillgist(m): 9:11am On Aug 08, 2018 |
Travellers moving out of the capital city Abuja have been blocked due to protests from tanker drivers. The Nigerian police shot a tanker driver tires and all tanker drivers there have blocked that particular exit from Abuja. Photos below: 1 Share
|
Music/Radio / Re: A Thread for Lovers of EDM by chillgist(m): 7:37pm On May 30, 2018 |
Music/Radio / Re: A Thread for Lovers of EDM by chillgist(m): 3:05pm On Jan 07, 2018 |
Hello EDM fams, here is a link to the EDM LOVERS WhatsApp group for daily gists, news, songs, videos on all edm DJs and artists. https:///9JYjmEW0h1sHnAdjztP9Tk
|
(Go Up)
Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health religion celebs tv-movies music-radio literature webmasters programming techmarket Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10) Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 24 |