Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ _sendServer()

void ReLogic.Peripherals.RGB.SteelSeries.GameSenseConnection._sendServer ( Uri uri,
string data )
inlineprivate

Definition at line 451 of file GameSenseConnection.cs.

452 {
453 byte[] bytes = Encoding.ASCII.GetBytes(data);
454 HttpWebRequest httpWebRequest = (HttpWebRequest)WebRequest.Create(uri);
455 httpWebRequest.ContentType = "application/json";
456 httpWebRequest.Method = "POST";
457 Stream requestStream = httpWebRequest.GetRequestStream();
458 requestStream.Write(bytes, 0, bytes.Length);
459 requestStream.Close();
460 _currentRequest = httpWebRequest;
461 try
462 {
463 ((HttpWebResponse)httpWebRequest.GetResponse()).Close();
464 }
465 catch
466 {
467 }
468 }
virtual void Close()
Definition Stream.cs:644
void Write(byte[] buffer, int offset, int count)
override Stream GetRequestStream()
override WebResponse GetResponse()
static WebRequest Create(Uri requestUri, bool useUriBase)
static Encoding ASCII
Definition Encoding.cs:511

References ReLogic.Peripherals.RGB.SteelSeries.GameSenseConnection._currentRequest, System.Text.Encoding.ASCII, System.bytes, System.IO.Stream.Close(), System.Net.WebRequest.Create(), System.Net.HttpWebRequest.GetRequestStream(), System.Net.HttpWebRequest.GetResponse(), and System.IO.Stream.Write().

Referenced by ReLogic.Peripherals.RGB.SteelSeries.GameSenseConnection._sendMsg(), and ReLogic.Peripherals.RGB.SteelSeries.GameSenseConnection.SendJson().