Thread Socket-Server, ich verstehe es nicht ganz: Perl-Server+C#-Client-> Bi-Direkt.-Verbi (15 answers)
Opened by Gast at 2007-02-20 14:14

esskar
 2007-02-21 13:47
#37472 #37472
User since
2003-08-04
7321 Artikel
ModeratorIn

user image
hmm, wie wäre es damit; so als ansatz!

Code: (dl )
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
using System;
using System.Text;
using System.Net;
using System.Net.Sockets;

namespace Esskar {
public class TcpSocket : Socket
{
public TcpSocket()
: base(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp) { }

public void Bind(IPAddress address, int port)
{
Bind(new IPEndPoint(address, port));
}

public void Listen()
{
Listen(5);
}

public int Send(string str) {
return this.Send(str, Encoding.ASCII);
}

public int Send(string str, Encoding enc) {
byte[] sendBytes = enc.GetBytes(str);
return this.Send(sendBytes);
}
}
}

View full thread Socket-Server, ich verstehe es nicht ganz: Perl-Server+C#-Client-> Bi-Direkt.-Verbi