Re: Socket problem plz read.
| From: | Scripter47 | Date: | Wed, 31 Jan 2007 15:26:47 +0000 |
| Subject: | Re: Socket problem plz read. | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-248086@lists.php.net to get a copy of this message | ||
I'm making a simple socket server that just receive some data, and then
send some data back again to the client.
EDIT:
I forgot to tell that i need help!
I have search around for hours now, and the examples are always not what
I needed :(
the program is written in Python, if that helps, and is something like this
<code>
# Set the socket parameters
host = "http://localhost/in/sql.php"
port = 10000
buf = 10000
addr = (host,port)
# Create socket
UDPSock = socket(AF_INET, SOCK_DGRAM)
# Send messages:
# Loop
while (1):
# userinput
data = raw_input('>> ')
if not data:
break
else:
# Send to the PHP page
if(UDPSock.sendto(data,addr)):
print "Sending message '",data,"'....."
# Close socket
UDPSock.close()
</code>
it is a program that send data by sockets, (not port 80)
It has to a simple solution :)
plz ask for more information.
--
_________ .__ __ ______________
/ _____/ ___________|__|______/ |_ ___________ / | \______ \
\_____ \_/ ___\_ __ \ \____ \ __\/ __ \_ __ \/ | |_ / /
/ \ \___| | \/ | |_> > | \ ___/| | \/ ^ / / /
/_______ /\___ >__| |__| __/|__| \___ >__| \____ | /____/
\/ \/ |__| \/ |__|