Click here to Skip to main content
15,909,325 members
Home / Discussions / Mobile
   

Mobile

 
GeneralRe: How to load a Bitmap over a dialog faster ? Pin
João Paulo Figueira1-Sep-04 7:40
professionalJoão Paulo Figueira1-Sep-04 7:40 
Generallogging on PocketPc Pin
Anonymous23-Aug-04 12:06
Anonymous23-Aug-04 12:06 
GeneralBlueTooth serial port Pin
Cedric Moonen23-Aug-04 1:08
Cedric Moonen23-Aug-04 1:08 
GeneralRe: BlueTooth serial port Pin
LittleYellowBird27-Aug-04 1:14
LittleYellowBird27-Aug-04 1:14 
GeneralRe: BlueTooth serial port Pin
Cedric Moonen27-Aug-04 1:34
Cedric Moonen27-Aug-04 1:34 
GeneralRe: BlueTooth serial port Pin
LittleYellowBird7-Sep-04 0:48
LittleYellowBird7-Sep-04 0:48 
GeneralRe: BlueTooth serial port Pin
lbendlin4-Nov-04 9:17
lbendlin4-Nov-04 9:17 
GeneralProblem in HTTP POST Pin
khchan22-Aug-04 18:48
khchan22-Aug-04 18:48 
hi,

my app is constituted by a http client (ppc emulator) and a http server (desktop).

the server accepts multipart POST.

my problem is that, sometimes the server can just receive the http header sent by the client. i dunno it's the problem of my server or client. Confused | :confused:

here is my code segment:
CLIENT:
WebRequest request;
Stream requestStream;

try
{
request = HttpWebRequest.Create(url);
request.ContentType = "multipart/form-data; boundary=" + boundaryString + "\r\n";
request.ContentLength = message.Length;
request.Method = "POST";
request.Timeout = 10000;

requestStream = request.GetRequestStream();
requestStream.Write(message, 0, message.Length);

// Close the Stream object.
requestStream.Close();


// 1. Get the Web Response Object from the request
WebResponse response = request.GetResponse();

// 2. Get the Stream Object from the response
Stream responseStream = response.GetResponseStream();

// 3. Create a stream reader and associate it with the stream object
StreamReader reader = new StreamReader (responseStream);

// 4. read the entire stream
results = reader.ReadToEnd();

reader.Close();
responseStream.Close();
}

catch(WebException webEx)
{
results = "An exception occurred relating to the use of " +
"a web response or request object. The specific exception was:" +
webEx.Message;
}

//Did some type of general exception occur?
catch(Exception ex)
{
results = "A general exception occurred while attempting to " +
"retrieve the requested page." +
ex.Message;
}

SERVER:
private void AcceptCallback(IAsyncResult ar)
{
// Signal the main thread to continue.
allDone.Set();

// Get the socket that handles the client request.
Socket listener = (Socket) ar.AsyncState;
Socket handler = listener.EndAccept(ar);
f1.ShowSystemMessage("\r\nClient Connected!!"
+"\r\n=================="
+"\r\nCLient IP "
+ handler.RemoteEndPoint + "\r\n");

// Create the state object.
StateObject state = new StateObject();
state.workSocket = handler;

handler.BeginReceive(state.buffer, 0, StateObject.BufferSize, 0,
new AsyncCallback(ReadCallback), state);
}

private void ReadCallback(IAsyncResult ar)
{
String content = String.Empty;

// Retrieve the state object and the handler socket
// from the asynchronous state object.
StateObject state = (StateObject) ar.AsyncState;
Socket handler = state.workSocket;

// Read data from the client socket.
int bytesRead = handler.EndReceive(ar);

if (bytesRead > 0)
{
state.sb.Append(Encoding.ASCII.GetString(state.buffer));

f1.ShowSystemMessage(state.sb.ToString());
ProcessRequest(state);

// Check for end-of-file tag. If it is not there, read more data.
content = state.sb.ToString();

// All the data has been read from the client. Display it on the console.
f1.ShowSystemMessage("Read " + content.Length.ToString()
+ " bytes from socket. \r\n Data : " + content );

state.ClearSB();
}//end if
}

thanks Blush | :O
GeneralS/Getting wireless client adapter information Pin
Clay20-Aug-04 14:52
Clay20-Aug-04 14:52 
QuestionBluetooth HOW TO? Pin
zoid ! 20-Aug-04 12:10
zoid ! 20-Aug-04 12:10 
AnswerRe: Bluetooth HOW TO? Pin
zoid ! 23-Aug-04 8:22
zoid ! 23-Aug-04 8:22 
GeneralRe: Bluetooth HOW TO? Pin
LittleYellowBird6-Sep-04 5:46
LittleYellowBird6-Sep-04 5:46 
GeneralPPC 2003 for MIPS Pin
rmkmani20-Aug-04 1:14
rmkmani20-Aug-04 1:14 
GeneralRe: PPC 2003 for MIPS Pin
Ian Darling20-Aug-04 6:34
Ian Darling20-Aug-04 6:34 
GeneralHelp trapping Sync event with .NET CF Pin
Andre Oschadlin20-Aug-04 1:09
Andre Oschadlin20-Aug-04 1:09 
Generalborderless combobox Pin
jatin@indus20-Aug-04 0:55
jatin@indus20-Aug-04 0:55 
GeneralButton text problem. Pin
and_vb18-Aug-04 23:33
and_vb18-Aug-04 23:33 
GeneralMFC dlls question Pin
Rassul Yunussov18-Aug-04 18:18
Rassul Yunussov18-Aug-04 18:18 
GeneralRe: MFC dlls question Pin
João Paulo Figueira18-Aug-04 23:29
professionalJoão Paulo Figueira18-Aug-04 23:29 
General.NET CF and eVC++ Pin
monn18-Aug-04 16:19
monn18-Aug-04 16:19 
GeneralRAPI Question Pin
Rassul Yunussov17-Aug-04 8:19
Rassul Yunussov17-Aug-04 8:19 
GeneralRe: RAPI Question Pin
João Paulo Figueira17-Aug-04 8:51
professionalJoão Paulo Figueira17-Aug-04 8:51 
GeneralTAPI GSM modem connection Pin
montons17-Aug-04 5:00
montons17-Aug-04 5:00 
GeneralModeless Dialog Problem Pin
Rassul Yunussov16-Aug-04 21:48
Rassul Yunussov16-Aug-04 21:48 
GeneralRe: Modeless Dialog Problem Pin
João Paulo Figueira17-Aug-04 0:59
professionalJoão Paulo Figueira17-Aug-04 0:59 

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.