Re: [PHP] Socket problem plz read.



On sze, 2007-01-31 at 16:26 +0100, Scripter47 wrote:
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

this is PHP list. go to Python list with that, I suggest

greets
Zoltán Németh

<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.




--
_________ .__ __ ______________
/ _____/ ___________|__|______/ |_ ___________ / | \______ \
\_____ \_/ ___\_ __ \ \____ \ __\/ __ \_ __ \/ | |_ / /
/ \ \___| | \/ | |_> > | \ ___/| | \/ ^ / / /
/_______ /\___ >__| |__| __/|__| \___ >__| \____ | /____/
\/ \/ |__| \/ |__|

.



Relevant Pages

  • Re: Winsock / Sockets programming
    ... At the client side receive message from the server only, ... socket on one port. ... And connect everybody to that socket like a big ...
    (microsoft.public.vc.mfc)
  • Re: Possible bug in .Net 2.0 udp sockets?
    ... assumption that the port which the client sees is the same as the port ... get the correct endpoints under simple circumstances. ... multiple outstanding BeginReceiveFrom's on a UDP socket are not supported, ...
    (microsoft.public.dotnet.framework)
  • Re: Winsock / Sockets programming
    ... At the client side receive message from the server only, ... A target of a network connection is a <ip-address, socket#> pair. ... outside the walls of your environment, you should apply to IANA for a Registered Port ... the client has to know the IP address of each potential server. ...
    (microsoft.public.vc.mfc)
  • Re: VB.NET Socket - Multiple clients to server
    ... Private MySocket As Socket ... Dim ipHostInfo As IPHostEntry = Dns.GetHostByName) ... 'Looping periodically on MyTcpListener to see if any client try to ... And I wouldn't have to care anymore with port number? ...
    (microsoft.public.dotnet.languages.vb)
  • Re: VB.NET Socket - Multiple clients to server
    ... Private MySocket As Socket ... Dim ipHostInfo As IPHostEntry = Dns.GetHostByName) ... 'Looping periodically on MyTcpListener to see if any client try to ... And I wouldn't have to care anymore with port number? ...
    (microsoft.public.dotnet.general)