Membership is FREE – with unlimited access to all features, tools, and discussions. Premium accounts get benefits like banner ads and newsletter exposure. ✅ Signature links are now free for all. 🚫 No AI-generated (LLM) posts allowed. Share your own thoughts and experience — accounts may be terminated for violations.

PHP Sockets Help

Status
Not open for further replies.
Joined
Aug 26, 2004
Posts
325
Reaction score
55
Hi all,

I'm just rewriting a couple of my PHP scripts and am trying to make use of 'socket_set_option($socket, IPPROTO_TCP,TCP_NODELAY,1)' (set just before socket_create()) for packet management. I'm not the greatest programmer in the world so does anyone have any idea why it doesn't seem to work and why I'm getting these messages:

PHP Notice: Use of undefined constant IPPROTO_TCP - assumed 'IPPROTO_TCP'
PHP Notice: Use of undefined constant TCP_NODELAY - assumed 'TCP_NODELAY'

With the very few examples that I have found, there seems to be nothing wrong with my use of socket_set_option so I just wondered if anyone had any ideas about it?

Thanks!

Chris
 
Thanks Dave but I'm on 5.3.2. I've just noticed that 5.3.3 was released two days ago - so I'll give that a try. Maybe it's a bug in 5.3.2.
 
Nope, that didn't do the trick either. It's dodgy coding and not a bug then! At least I'm up to date with PHP now though!
 
You do have sockets compiled into your php don't you? Most hosts do, but better to check! You''ll need a quick php page with phpinfo() or php -v from command line
 
Again thanks for the suggestion. I do have sockets set, yes. Sockets work fine; it's just the socket_set_option function that doesn't.
 
Status
Not open for further replies.

Rule #1: Be Respectful

Do not insult any other member. Be polite and do business. Thank you!

Premium Members

New Threads

Domain Forum Friends

Our Mods' Businesses

*the exceptional businesses of our esteemed moderators
General chit-chat
Help Users
  • No one is chatting at the moment.
  • Siusaidh AcornBot:
    Siusaidh has left the room.
      Siusaidh AcornBot: Siusaidh has left the room.
      Top Bottom