CHronologist Posted April 27, 2008 Share Posted April 27, 2008 I browsed the forum several times but found nothing like my problem. I was trying to write a simple application that should be able to communicate through the network. So I have to programms and each transmitts his data to the other one. I tried a lot, but nothing worked. Router port is forwarded. Here my idea how it was intended: Server UDPStartup() $socket = UDPBind($IP, $port) Do $clientip = UDPRecv($socket, 1024) until $clientip <> "" $connection = UDPOpen($clientip, $port) UDPSend($connection, "ok") Client UDPStartup() $socket = UDPOpen($IP, $port) $connection = UDPBind(_GetIP(), $port) UDPSend($socket, _GetIP()) The idea was to start the Server, this opens a socket, waits for an incoming file. Then you start the Client, that creates a connection and an open socket, then transmitts his IP to the Server, so that the Server can establish a connection to the Client. Sending data from the Client to the Server works, but not the oter direction. Thanks for every constuctive comment. Link to comment Share on other sites More sharing options...
flip209 Posted April 27, 2008 Share Posted April 27, 2008 I do not see a UDPRecv for the client " I haven't failed. I've just found 10,000 ways that won't work." Thomas Edison "You cannot help men permanently by doing for them what they could and should do for themselves." Abraham Lincoln Link to comment Share on other sites More sharing options...
CHronologist Posted April 27, 2008 Author Share Posted April 27, 2008 $comm = UDPRecv($connection, 1024) Something like that what I posted was just the initiation part of the connetions. Link to comment Share on other sites More sharing options...
CHronologist Posted April 29, 2008 Author Share Posted April 29, 2008 ok problem found, seemed like I used wrong sockets while using TCP functions. delete or close or so Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now