2
是否有可能在PHP中複製此C#程序?PHP網絡套接字
var chatsrv = new IPEndPoint(IPAddress.Parse(_charUrl), _chatPort);
_chatsocket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
_chatsocket.Connect(chatsrv);
var ns = new NetworkStream(_chatsocket);
_nw = new BinaryWriter(new BufferedStream(ns));
var nr = new BinaryReader(ns);
_nw.Write((byte)(0xff));
_nw.Write(acc.AccountId);
_nw.WriteUtf8String(acc.AuthCookie);
_nw.Write((UInt32)2);
_nw.Flush();
var response = nr.ReadBytes(nr.ReadInt32());
這是如果有人想從PHP溝通,它使用前綴的郵件指定其消息的大小的應用程序的解決方案?對不起這個基本的問題,但我不是一個專業的開發人員... – Mike 2011-08-06 01:21:04