Hello Melvin, Wrong concept. A Server socket only listens for incoming connections. In OnSessionAvailable the incoming socket has to but accepted to a 'data socket'. So server does nothing else but listening, it does never send/receive data.
There is an example with TWSocket in the ICS package, dont knot teh name from top of my head. But there are many samples with TWSocketServer witch will make life more easier for you. Please check tehm. --- Rgds, Wilfried http://www.mestdagh.biz Tuesday, April 5, 2005, 07:30, Mathews, Melvin wrote: > Hi All, > I have set OnSessionAvailable event for a socket that acts as server as > follows > Server1 := TWSocket.Create(nil); > with Server1 do begin > Proto := 'tcp' ; > Addr := MyAddress ; > Port := IntToStr(Fport) ; > OnSessionAvailable := Avaialable ;//my method > Listen ; > end ; > Now when I send data to this socket, Server is getting data first time > but next time onwards no data reaches the server. > When I went deeper to code with in procedure > TCustomWSocket.WMASyncSelect(var msg: TMessage); event, > the condition > Check := msg.lParamLo and FD_ACCEPT; > if Check <> 0 then begin > TriggerSessionAvailable(msg.lParamHi); > end; > gets triggered only once, when I am sending data first time. But never > again. Only when the socket satisfies the ACCEPT condition I see > OnSessionAvailable event getting triggered. So it never returns to > ACCEPT mode after first send and switches between READ and WRITE modes. > It is LISTENING but not ACCPTING Do not know what should be done to make > it to ACCEPT mode. The connection never gets closed also. No idea whats > happening > Any thoughts? > Regards, > Melvin. > -- > To unsubscribe or change your settings for TWSocket mailing list > please goto http://www.elists.org/mailman/listinfo/twsocket > Visit our website at http://www.overbyte.be -- To unsubscribe or change your settings for TWSocket mailing list please goto http://www.elists.org/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be