Click here to Skip to main content
15,867,568 members
Home / Discussions / C#
   

C#

 
QuestionWhat to write? Pin
Skylinemailer25-Jan-03 3:59
Skylinemailer25-Jan-03 3:59 
AnswerRe: What to write? Pin
leppie25-Jan-03 4:33
leppie25-Jan-03 4:33 
AnswerRe: What to write? Pin
Vagif Abilov25-Jan-03 6:16
professionalVagif Abilov25-Jan-03 6:16 
GeneralDateTimePicker Control Pin
Mr BallyDaHob25-Jan-03 3:33
Mr BallyDaHob25-Jan-03 3:33 
GeneralRe: DateTimePicker Control Pin
leppie25-Jan-03 4:43
leppie25-Jan-03 4:43 
GeneralRe: DateTimePicker Control Pin
Mr BallyDaHob25-Jan-03 5:39
Mr BallyDaHob25-Jan-03 5:39 
QuestionC# RegEx text parsing??? Pin
Kevin S.24-Jan-03 10:03
Kevin S.24-Jan-03 10:03 
QuestionTcpListener Hangs at 4096 bytes? Pin
Daniel Bright24-Jan-03 9:01
Daniel Bright24-Jan-03 9:01 
The BeginListener function will not receive any information from the socket
past a certain amount (apparently 4096 bytes). Information sent that is
smaller than that is received properly. If data is sent that is larger than
that, it's truncated to 4096 bytes, and then the while loop exits (which it
should never do).

<br />
private void BeginListener()<br />
{<br />
 byte[] b = new byte[10000000];<br />
 int k;<br />
 Socket s;<br />
 String strMessage = "";<br />
<br />
 TcpListener newList = new TcpListener(10000);<br />
 newList.Start();<br />
 while (true)<br />
 {<br />
  strMessage = "";<br />
<br />
  s = newList.AcceptSocket();<br />
  k = s.Receive(b);<br />
<br />
  for (int nCounter = 0; nCounter < k; nCounter++)<br />
  {<br />
   strMessage += (char)b[nCounter];<br />
  }<br />
 }<br />
 newList.Stop();<br />
}<br />

<br />
<br />
private void SendCommand(String Address,String strTempFile)<br />
{<br />
 StreamReader newReader = new StreamReader(strTempFile);<br />
 String strSendString = newReader.ReadToEnd();<br />
 newReader.Close();<br />
<br />
 newClient = new TcpClient();<br />
 NetworkStream tcpStream = null;<br />
 byte[] ba;<br />
<br />
 try<br />
 {<br />
  newClient.Connect(Address,10000);<br />
  tcpStream = newClient.GetStream();<br />
  ASCIIEncoding asem = new ASCIIEncoding();<br />
  ba = asem.GetBytes(strSendString);<br />
  tcpStream.Write(ba,0,ba.Length);<br />
 }<br />
 catch (System.Net.Sockets.SocketException)<br />
 {<br />
  //Error Handling.<br />
 }<br />
 finally<br />
 {<br />
  if (tcpStream != null) {tcpStream.Close();}<br />
  if (newClient != null) {newClient.Close();}<br />
 }<br />
}<br />

Any help would be greatly appreciated.
AnswerRe: TcpListener Hangs at 4096 bytes? Pin
Heath Stewart24-Jan-03 10:14
protectorHeath Stewart24-Jan-03 10:14 
AnswerRe: TcpListener Hangs at 4096 bytes? Pin
Stephane Rodriguez.24-Jan-03 10:18
Stephane Rodriguez.24-Jan-03 10:18 
QuestionHow do I draw on a bitmap? Pin
MikeBeard24-Jan-03 8:48
MikeBeard24-Jan-03 8:48 
AnswerRe: How do I draw on a bitmap? Pin
Heath Stewart24-Jan-03 8:55
protectorHeath Stewart24-Jan-03 8:55 
GeneralRe: How do I draw on a bitmap? Pin
MikeBeard24-Jan-03 9:01
MikeBeard24-Jan-03 9:01 
GeneralRe: How do I draw on a bitmap? Pin
Heath Stewart24-Jan-03 10:11
protectorHeath Stewart24-Jan-03 10:11 
GeneralRe: How do I draw on a bitmap? Pin
MikeBeard24-Jan-03 10:46
MikeBeard24-Jan-03 10:46 
GeneralRe: How do I draw on a bitmap? Pin
Heath Stewart24-Jan-03 11:37
protectorHeath Stewart24-Jan-03 11:37 
GeneralRe: How do I draw on a bitmap? Pin
MikeBeard25-Jan-03 11:07
MikeBeard25-Jan-03 11:07 
GeneralRe: How do I draw on a bitmap? Pin
Heath Stewart25-Jan-03 11:12
protectorHeath Stewart25-Jan-03 11:12 
GeneralRe: How do I draw on a bitmap? Pin
MikeBeard27-Jan-03 3:44
MikeBeard27-Jan-03 3:44 
AnswerRe: How do I draw on a bitmap? Pin
MikeBeard24-Jan-03 11:25
MikeBeard24-Jan-03 11:25 
GeneralAdding File Type actions Pin
Waleed Zedan24-Jan-03 6:07
Waleed Zedan24-Jan-03 6:07 
Generalsilly gui question/request Pin
bertb24-Jan-03 3:50
bertb24-Jan-03 3:50 
QuestionWhat happens with events if computer is slow. Pin
Zinj24-Jan-03 2:24
sussZinj24-Jan-03 2:24 
AnswerRe: What happens with events if computer is slow. Pin
leppie24-Jan-03 6:16
leppie24-Jan-03 6:16 
GeneralRe: What happens with events if computer is slow. Pin
jinz25-Jan-03 11:40
jinz25-Jan-03 11:40 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.