🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

nobody here who can help me?

Started by
3 comments, last by elmo 23 years, 11 months ago
hello! ive got a client<->server async model of winsock programmed. the server accepts perfectly the request of the client and build up a new socket... than the server sends "HELLO CLIENT" in the servers FD_WRITE event and this text reaches perfectly the client... but how can i send more text... i never get an FD_WRITE event later.. only this one at connect - why ? i read somewhere that i must reenable the FD_WRITE or FR_READ event - is this true? i cant help me anymore... there is no tutorial on the net that explain my problem! it will be great if somebody can help me thanks for all elmo
Advertisement
From what I can take from my client server book (I am just reading up on the topic, just in case), you can use write(socket_num, message, number_of_bytes); to send a message to the client. I don't see any flag switching to do it, but I might be wrong... I don't have access to anything to test out the code right now.

Edited by - Whirlwind on August 1, 2000 1:00:12 PM
Even though I use winsock, I dont use the windows specific extensions for portability reasons, so this is taken from directly from the refrence.

From Windows Scokets Network Programming book by Bob Quinn and Dave Shute, great book for winsock btw.

"Your application could use the first FD_WRITE notification to initiate a data transfer if your applicaiton is designed to send data before reciving any. You will only get subsqeuent FD_WRITE messages if a call to send () or sento () fails with the WSAEWOULDBLOCK error. In this event, you can resume the data trasnfer where if left off by using the same buffer pointer refrenced when the send function failed."

It also mentions that you would rarely get the FD_WRITE event (except the first ofcourse) on datagram sockets as they arn''t buffered and unreliable.

I think it''s similar to a state machine. Once it enters a state, its assume to be valid until otherwise noted, for instance when you try to send and it blocks, then the state would be block, and you can wait for the next FD_WRITE telling you it''s unblocked. I suggest creating a state machine wrapper socket class if your going to use this method as it will keep the socket state management cleaner and centeralized.

-ddn
sorry, but its not easy to follow your text because me english is not so good.
the book you told from (network programming bob quinn, dave shute) - i have ordered it last week but amazon cant deliver it

ok now... the problem is that i havnt understand so much from your text... ok thats my problem - there is no german reference of winsock or a book - thats bad

is it right that i cant send data at any time i want? or recv data at any time i want? in all tutorials its seems easy to connect to a server and send or recv data... but all tutorials never show it in a full sample. anybody told me that winsock is very easy (expecialy with the book you told me) ... so i think i have to wait if amazon is ready to deliver the book (3-5 weeks)

perheps i should code some otherthings in my game befor i got mad with this winsock stuff

if anybody can help anyway - please HELP ME !!!!

thanks to all
elmo

Yes, i think it''s best you wait for the book. Winsock programming is rather complicated, and the books goes into detail about how to program using the windows specific winsock API.

Good Luck!

-ddn

This topic is closed to new replies.

Advertisement